How do I check if my query returned no rows
Moderator: General Moderators
How do I check if my query returned no rows
I need to execute a snippet based on whether my query returned rows or is empty. Can you help me out?
Last edited by pickle on Fri Aug 14, 2009 5:48 pm, edited 1 time in total.
Reason: Stop user from YELLING AT THE BOARDS (removed all caps in subject)
Reason: Stop user from YELLING AT THE BOARDS (removed all caps in subject)
Re: How do I check if my query returned no rows
It's not polite to YELL AT THE BOARDS. WE CAN READ JUST FINE WHEN THE TEXT IS properly cased. I've updated your post accordingly.
Assuming you're using MySQL, look into mysql_num_rows() or preferably mysqli_num_rows()
Assuming you're using MySQL, look into mysql_num_rows() or preferably mysqli_num_rows()
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.