Click to See Complete Forum and Search --> : mysql quert result question


barantamer
04-12-2008, 04:27 AM
hello i want to know if mysql query did not return a result.
Below code is not working..

$result=mysql_query("select * from forum_user where username='$username' and confirm='$confirm'");


if($result==NULL){
echo "no result";

}
else{

$row = mysql_fetch_array($result);
// etc........
}

any help ?

bokeh
04-12-2008, 05:11 AM
if(mysql_num_rows($result) === 0)
{
# no result
}