Jump to content

How to find out if nothing is returned from query


cliftonbazaar

Recommended Posts

I have the following code

$results=mysqli_query($mysqli, $sql_statement);

and I wish to find out what happens if no results are returned.

 

I have tried

if(!$results) echo "Hello";

but nothing ever gets printed out :(

So how can I find out if $results is empty?

 

James

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.