How can I query the total number of data records in a table? how can I query the total number of data records in a database table? I wrote $ resultmysql_query (& quot; selectcount (*) from table name & quot;); or $ resultmysql_query (& quot; select * from table name & quot ;); but how can I convert the returned results to a number? how can I query the total number of data records in a table?
How can I query the total number of data entries in a database table?
Help me write an example
That's what I wrote.
$ Result = mysql_query ("select count (*) from table name"); or
$ Result = mysql_query ("select * from table name ");
But how can I convert the returned results to a number?
------ Solution --------------------
$ Result = mysql_query ("select count (*) as max from table name ");
$ Re = mysql_fetch_object ($ result );
$ Max = $ re-> max;
$ Max indicates the number of all records.
------ Solution --------------------
$ Result = mysql_query ("select * from table name ");
$ Num_rows = mysql_num_rows ($ result );
This is fine.