PHP Check for NULL

后端 未结 5 541
后悔当初
后悔当初 2020-11-30 11:04

Here is the below Code:

$query = mysql_query(\"SELECT * FROM tablex\");

if ($result = mysql_fetch_array($query)){

    if ($result[\'column\'] == NULL) { pr         


        
5条回答
  •  失恋的感觉
    2020-11-30 11:16

    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.

提交回复
热议问题