![]() |
MySQL Count Rows
Hello Everybody,
I think i'm looking around the right area but struggling and would really appreciate any help. Basically, I'm want to count how many 'rows' I have in my DB table and then display that figure in the AdminCP like Total: $totalrows. I also want to be able to put a SQL constraint in, for example count how many 'rows' for id=0. Any help? Thanks, Paul. |
Just use the mysql count function.
select count(*) from table or select count(*) from table where foo=bar |
This seems like a really noob error but I cant get it working.
I have this SQL statement: Quote:
Total Products: $counttotalproduct But its showing up as: Total Products: Resource id #17 Any help? Thanks, Paul. |
You need to loop the results to find the value, alternatively, do this instead:
PHP Code:
|
Quote:
Thanks, Paul. |
All times are GMT. The time now is 09:42 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|