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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.