Coolist is quite right, of course. This would not belong in the PHP forum, but rather in one of the database forums.
Considering that this was posted in the PHP forum, I have moved it over to the MySQL forum for now. Let me know if it should be somewhere else please.
As to your question, using the COUNT function should give you the results you need.
That is, if you were to do:
-
SELECT COUNT(*) FROM test;
-
And we assume the test table is empty, it should give you something like:
-
mysql> SELECT COUNT(*) FROM test;
-
+----------+
-
| COUNT(*) |
-
+----------+
-
| 0 |
-
+----------+
-
To get that result in PHP, you would of course have to read the value returned by the query, as opposed to the row count.