Is it possible to do something like the WHERE clause in a mysql_num_rows statement in PHP开发者_JS百科? For example, say I have the column "number" in my database. I want to use mysql_num_rows($number) to display how many rows have the number 1. I know the other ways to do this, but it would be much much easier for what I'm doing to be able to use mysql_num_rows with a WHERE clause.
SELECT COUNT(*) cnt FROM tablename WHERE rowname = 1
With this query you don't need mysql_num_rows
which is overhead for cases when you don't need the data itself but the number of rows.
精彩评论