I have been looking at the mysql functions. I am unsure on how to desplay a the number of a certain value. What my script is for is testimonials. On the admin side I am wanting to be able to display beside the word Active, New, Onhold the amount of testimonials in that catigory. The way they are marked in the database is n=new, y=approved, and h=onhold. How can I get it to display the number of testimonials by the coresponding word/catigory.
You can see the script here. http://www.lsscripts.com/lst/admin/ If you look in the Records section you will see that I am wanting the number to display on the right side of each word.
I need correct mysql_fetch_ for my script.
Moderator: General Moderators
MySQL's 'GROUP BY' would be a good place to start... Scan through the following parts of the manual for more info:
http://dev.mysql.com/doc/mysql/en/SELECT.html
http://dev.mysql.com/doc/mysql/en/Group ... fiers.html
Basicly, you could do something similiar to...
http://dev.mysql.com/doc/mysql/en/SELECT.html
http://dev.mysql.com/doc/mysql/en/Group ... fiers.html
Basicly, you could do something similiar to...
Code: Select all
select category, count(category) from table group by category