Here is the below Code:
$query = mysql_query(\"SELECT * FROM tablex\");
if ($result = mysql_fetch_array($query)){
if ($result[\'column\'] == NULL) { pr
Sometimes, when I know that I am working with numbers, I use this logic (if result is not greater than zero
):
if (!$result['column']>0){
}
I think you want to use
mysql_fetch_assoc($query)
rather than
mysql_fetch_row($query)
The latter returns an normal array index by integers, whereas the former returns an associative array, index by the field names.
Use is_null or ===
operator.
is_null($result['column'])
$result['column'] === NULL
Make sure that the value of the column is really NULL and not an empty string or 0.
How about using
if (empty($result['column']))