The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
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. |
#2
|
||||
|
||||
Just use the mysql count function.
select count(*) from table or select count(*) from table where foo=bar |
#3
|
|||
|
|||
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. |
#4
|
||||
|
||||
You need to loop the results to find the value, alternatively, do this instead:
PHP Code:
|
#5
|
|||
|
|||
Quote:
Thanks, Paul. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|