Value.
For example.
Method 1:
CopyCodeThe Code is as follows: $ SQL = "select * Form ABC"
$ Result = mysql_query ($ SQL );
$ ROW = mysql_fetch_array ($ result );
If (empty ($ row) // start to judge whether it is null
{
Echo "null ";
}
Else
{
Echo "not null ";
}
Method 2: Copy codeThe Code is as follows: $ SQL = "select * Form ABC"
$ Result = mysql_query ($ SQL );
$ ROW = mysql_fetch_array ($ result );
If (! $ Row) // It is null enough to start judgment.
{
Echo "null ";
}
Else
{
Echo "not null ";
}
In fact, when the mysql_fetch_array function is used, if the table is an empty table, false is returned. $ row is not assigned at this time.
The value is successful.
Remember, never dare to use $ ROW = mysql_fetch_array ($ result) or die (mysql_error () like this ());
If it is yo or die, thenProgramIf mysql_fetch_array is executed, the execution is terminated.