can some one help me word a sql query that selects the total amount of columns in the table, ex:
====================================
id | text | text 2 |
====================================
1 | dddf | dddd
________________________________________|
2 | dddf | dddd
________________________________________|
3 | dddf | dddd
________________________________________|
4 | dddf | dddd
________________________________________|
^
||
I want it to output 4
SQL Query Help
Moderator: General Moderators
I assume, as did feyd, that you mean rows, not columns. If so, I would just do something like:
Code: Select all
...
$result=mysql_query('SELECT * FROM xxx');
$nr=mysql_num_rows($result);