Link to home
Start Free TrialLog in
Avatar of error77
error77

asked on

php sql query (if no results)

Hi all,

I have this code:

$SQL = "SELECT * FROM mytable where user_id='$userid'";
$result = mysql_query($SQL);

How can I tell it...

If (there are no results) {
  // do this
} else {
 // do something else
}

thanks



ASKER CERTIFIED SOLUTION
Avatar of Ryan Lanham
Ryan Lanham
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial