Page 1 of 1

I need correct mysql_fetch_ for my script.

Posted: Sat Jul 17, 2004 2:20 pm
by Lucnet
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.

Posted: Sat Jul 17, 2004 3:32 pm
by JAM
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...

Code: Select all

select category, count(category) from table group by category