0

hi there
i have table consist of 5 columns
it looks like this

id       title                     theme          image     category
1     PHP  tutorial       tutorial self      1.jpg       PHP
2     Javascript tutor   tutorial self      js.jpg      Javascript
3     PHP tutorial 2      tutorial self      ad.jpg    PHP

category here is changed
for ex: how i can count from that the amount of rows containing only PHP
thanks for attention

Edited by azegurb: n/a

4
Contributors
5
Replies
6
Views
7 Years
Discussion Span
Last Post by xylude
0

Hi,

You can do it with where condition in your mysql query like:

"select * from tablename where category='PHP'";

Try this one...

0
$var = mysql_query("SELECT * FROM table WHERE category = 'PHP'");
$rows = mysql_num_rows($var);

- the variable $rows should give you the number of rows where category = 'PHP'.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.