Jump to content

[SOLVED] Creating table rows for ever other loop in a WHILE loop


Recommended Posts

I'm trying to create a table using a MySQL fetch array while loop that would look like this:

 

CONTENT1    CONTENT2

CONTENT3    CONTENT4

CONTENT5    CONTENT6

 

I need a <TR></TR> for every other piece of content. But I don't know how to do this with a loop that uses a MySQL fetch array

 

 

while($row = mysql_fetch_array($result, MYSQL_ASSOC))

 

{

PHP CODE THAT IS LOOPED;};

 

I'm trying to remember from my old college Java class that we did something with loops for whenever the counter variable was even the loop would do something special...I don't know if this is possible with a while+mysql_fetch_array loop though

 

 

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.