When a query returns NULL?
Posted: Mon Aug 21, 2006 10:04 am
Hi u all,
I'm have a query that returns a value NULL when de query is empty, i compare this way:
But always print Have no Country!
. How is the correct way of makin' that comparison if the register is NULL.
Thanks...
I'm have a query that returns a value NULL when de query is empty, i compare this way:
Code: Select all
$conForo = ConcetarForo();
$sqlForo = printf("SELECT pais_user FROM phpbb_users WHERE username = '%s'", $_SESSION['login']);
$query = mssql_query($sqlForo,$conForo);
$resul = mssql_fetch_array($query);
f ($resul[0] == NULL){
echo 'Have no Country! ';
}
else{
echo 'Have country! ';
}Thanks...