feri_soft Posted April 29, 2006 Share Posted April 29, 2006 How to coun t results in mysql and display the number of the results.Something like numrows???How exactly Link to comment https://forums.phpfreaks.com/topic/8691-how-to-count-results/ Share on other sites More sharing options...
michaellunsford Posted April 29, 2006 Share Posted April 29, 2006 SELECT COUNT('some_field_name') FROM `some_table_name` AS total WHERE ...or were you looking for msql_num_rows()? Link to comment https://forums.phpfreaks.com/topic/8691-how-to-count-results/#findComment-31895 Share on other sites More sharing options...
feri_soft Posted April 29, 2006 Author Share Posted April 29, 2006 I think it is:msql_num_rows()because i want for example to show how many results there are.I have category design lets say and on the left i want to know how many are the articles in it.I use this"Select * from articles where cat_id=...."And then how to show how many are the articles from this category ;) Link to comment https://forums.phpfreaks.com/topic/8691-how-to-count-results/#findComment-31916 Share on other sites More sharing options...
kenrbnsn Posted April 29, 2006 Share Posted April 29, 2006 In mysql:[code]<?php$q = "Select * from articles where cat_id=....";$rs = mysql_query($q) or die('Problem with query: ' . $q . '<br>' . mysql_error());$n = mysql_num_rows($rs);echo $n;?>[/code]Ken Link to comment https://forums.phpfreaks.com/topic/8691-how-to-count-results/#findComment-31932 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.