I have data in my mysql fields which are NULL
But in php when getting the data into an array how come I can compare the value of it without first using php's isset?
Example,
$var = null;
if ($var == 123123) // GENERATES ERROR AS DIDN'T CHECK IF IT WAS SET FIRST
But in mysql
$q = $dbc -> prepare("SELECT nullColumn FROM table_1");
$q -> execute();
$null = $q -> fetch(PDO::FETCH_ASSOC);
if ($null['nullColumn'] == 2312312) // DOESN'T GENERATE ERROR EVEN THOUGH VALUE IS NULL
I have also used var_dump on the value and it returns NULL
issetif your value isnull. You might be mixing something up here. Care for an illustrative code sample?