Have a table that needs to have results written to it, that will later be updated. To check if the table has been written to yet I'm using this code:
When I do this it doesn't enter the if. I tried echoing $new_results and got Resource id #17. What does this mean and what am I doing wrong that prevents me from entering the if. I tried the sql statement in an sql command prompt and it gave me Empty set (0.00 sec), which I was hoping for.
Code:
$sql="SELECT DISTINCT [I]field[/I] FROM [I]table[/I] WHERE [I]field[/I]=".$[I]value[/I];
$new_result=mysql_query($sql,$db);
if (!$new_result)
{
[I]do xyz[/I]
}
Comment