Jump to content

Recommended Posts

I can identify an issue with your logic already, as:

 

while ($set2 = mysql_fetch_array($query))

 

mysql_fetch_array - Returns an array that corresponds to the fetched row and moves the internal data pointer ahead.

 

"moves the internal data pointer ahead" This means once the pointer moves to the end, it will not be looped again unless you reset the pointer like so:

 

mysql_data_seek($query);

 

I would like to see the rest of your code, though, as it looks like you may have more issues.

I can identify an issue with your logic already, as:

 

while ($set2 = mysql_fetch_array($query))

 

mysql_fetch_array - Returns an array that corresponds to the fetched row and moves the internal data pointer ahead.

 

"moves the internal data pointer ahead" This means once the pointer moves to the end, it will not be looped again unless you reset the pointer like so:

 

mysql_data_seek($query);

 

I would like to see the rest of your code, though, as it looks like you may have more issues.

 

The OP doesn't want to loop through the same results multiple times, and the loops use different MySQL results, so that shouldn't be an issue. It will be looped again if there are multiple results.

Essentially his logic would look like this:

 

Loop1 Output

  Loop2 Output

  Loop2 Output

  Loop2 Output

  Loop2 Output

 

Loop1 Output

Loop1 Output

Loop1 Output

Loop1 Output

 

Loop2 would execute once and then never do anything again. But as we have both said, we need the rest of the code to understand what you're doing.

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.