I got some help with gettin the number of rows returned from mysql, and it works fine…
BUT, how do I get the number of rows with a certain field value?
Do I have to make a new Mysql search query?
Here is the code where I query mysql and display in a table using fetch_array… Also, Im using mysql_num_rows to get number of rows.
So how do I get number of rows with certain field value also?
$qry_result = mysql_query($query) or die(mysql_error());
$num_rows = mysql_num_rows($qry_result);
while($row = mysql_fetch_array($qry_result))
Thanks for all help
OBSERVE: Im trying to avoid using another SELECT WHERE clause…
Is there a way to do what I want withouth another search?
In your query, you can use the
whereclause. (select * from table where column1 = ‘value’)Another option would be to have a counter variable that you increment in your while loop:
After you have this counter, reset the result set using mysql_data_seek($qry_result, 0); and then continue with your original while loop.