How would I check to see if the values returned from an sql query are empty? I tried using if(empty($var)), but that didnt work either. heres my code
PHP Code:
while($row = mysql_fetch_array($Result))
{
if(count($row) == 0)
{
....
}
}
How would i check to see if $row is empty?
This is the right way to do this, you can check if the results are empty by finding number of row in returned results. There is a function in sql to do this
mysql_num_rows. Here is the method to use it: