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 Quote Link to comment 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()? Quote Link to comment 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 ;) Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.