I have a rather complex query, with about 3 joins.
It returns 12 rows when I run the SQL code manually via phpMyAdmin.
However, when I paste it in my webpage, run the query, and call the
mysql_num_rows()
function, it returns 0!
To double-check, I had the program output the text of the query (with variables filled in, etc.) whenever it gave me "the bad news" that no results were found. I pasted that code into phpMyAdmin and, sure enough, 12 rows!
The PHP script should be finding 12 rows as well, but it doesn't seem to be!
The apparent contradiction, and not understanding this behavior of mysql_num_rows, is having me figuratively pulling my hair out. It makes no sense!
Has anyone else had this problem? If my last 1/2 hour of Googling is any indication, I'm guessing "no".
Thanks in advance,
Matthew
It returns 12 rows when I run the SQL code manually via phpMyAdmin.
However, when I paste it in my webpage, run the query, and call the
mysql_num_rows()
function, it returns 0!
To double-check, I had the program output the text of the query (with variables filled in, etc.) whenever it gave me "the bad news" that no results were found. I pasted that code into phpMyAdmin and, sure enough, 12 rows!
The PHP script should be finding 12 rows as well, but it doesn't seem to be!
The apparent contradiction, and not understanding this behavior of mysql_num_rows, is having me figuratively pulling my hair out. It makes no sense!
Has anyone else had this problem? If my last 1/2 hour of Googling is any indication, I'm guessing "no".
Thanks in advance,
Matthew
Comment