![]() |
interesting results and wonder why
Hi i was doing some counts for a admin page and i discovered my count was wrong and im not sure why the results are different.
If i post this in the sql of phpMyAdmin PHP Code:
But if i post this in my php like this PHP Code:
But if i post it in the file like this instead of using count just select all. PHP Code:
I wonder why count does not work i the file but works in the sql. And its the same statement? Strange.. any ideas? |
Your use of mysql_num_rows is incorrect.
Since you don't have a group by on your query, you end up with a count of all records matching the where criteria. In other words, you have 1 result, and that result is the number that match. Using a select without a count returns 2 records, which is why the mysql_num_rows shows that many. You need to fetch the count from the $gbio. |
| All times are GMT +1. The time now is 01:25 AM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.