Jump to content

while loop mysql_num_rows


fugix

Recommended Posts

ok guys, im going out the door so forgive me for not showing any code..but I have a while loop whithin a while loop to display rows for two different id's. I have a mysql_num_rows vaiable set that displays 0 because there are 0 rows with the userid of 1...then it displays 2 because there are 2 rows with the userid of 3..now what i want to do is find a way to omit the return of 0 so that i can use the return of 2 alone. sorry if im not clear enough.

Link to comment
Share on other sites

heres a snippet quick

 

while($friend_query_array = mysql_fetch_assoc($friend_query)) {

$friend_id = $friend_query_array['friend_id_array'];
$query = mysql_query("SELECT * FROM events WHERE userid=$friend_id ORDER BY id DESC");
$queryrow = mysql_num_rows($query);

 

if i echo $queryrow i get  02 for the two times that it checks the num rows

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.