Q:

Get number of rows in MySQL

Possible Duplicate:
Fastest way to count exact number of rows in a very large table? 

What query do I use to get the number of rows that share a common specification.
Example: The number of rows where idpost = 3

A:

You can use COUNT() documented here.
SELECT COUNT(1) FROM posts WHERE idpost = 3

EDIT: Updated according to dbf's suggestion.. Make sure you distinguish between COUNT(*) and COUNT(1), discussed here.

