JSHINER Posted March 5, 2007 Share Posted March 5, 2007 How can I display the number of rows in a table? There are ___ rows in this table. Link to comment https://forums.phpfreaks.com/topic/41313-simple-question-about-rows/ Share on other sites More sharing options...
skali Posted March 5, 2007 Share Posted March 5, 2007 $query = 'select count(*) from your_table'; $rs = mysql_query($query); if($rs) echo mysql_result($rs,0,0); Link to comment https://forums.phpfreaks.com/topic/41313-simple-question-about-rows/#findComment-200163 Share on other sites More sharing options...
chronister Posted March 5, 2007 Share Posted March 5, 2007 Or you could use <?php $query="SELECT * FROM table_name"; $result=mysql_query($query); $num=mysql_num_rows($result); ?> There are <?=$num ?> rows in this table. Link to comment https://forums.phpfreaks.com/topic/41313-simple-question-about-rows/#findComment-200187 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.