Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

When COUNT counts wrong

Status
Not open for further replies.

sinbadly

Technical User
Mar 16, 2006
126
GB
When I ask the table for this precise number of rows ...

Code:
$result2 = @mysql_query("SELECT COUNT(*)AS t FROM 067staff WHERE  m = '10' ");

... it doesn't. I'm using it for pagination on the website, but it shows every page as the last page.

Is there a way to make the code behave, please?
 
Hi

I do not believe this can be a MySQL issue.

There you are suppressing the error messages with the at ( @ ). In such cases put something like this after that :
Code:
if (!$result2) die('Invalid query: '.mysql_error());
Please confirm that the following gives incorrect result :
Code:
$row=mysql_fetch_assoc($result2);
echo $row['t'];
Otherwise you will have to repost this question in forum434 ( PHP ).

Feherke.
 
Yes, I am in the wrong section. Sorry, Feherke.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top