Hi
I want to display a message that says something if sql_result doesn't have any information in it. Query comes back empty.
I thought it would be as simple as: if ($sql_result == "") echo ("Message");
But it's not working.
I echoed $sql_result and it says "resource id #2".
Thanks!
Richard
That's because an sql result won't return an empty string. Try this:
if (!$sql_result) echo ("Message");
The exclamtion point will return true if the variable is false, or hasn't been set.
...but you probably already knew that. ::shrugs::
Hi Jared
Didn't work in this case. Message doesn't print and if I remove the exclamation mark the message prints all the time.
Can't get anything to work no matter what I do. Trying to make sense out of an isset() function that sounds like it might work but am getting nowhere.