Jump to content

[SOLVED] print alternate Rows


proctk

Recommended Posts

Hi the below code will return information from a mysql table.  The page that the results will be displayed on is divided in two colums. how do I get the results to print in alternate rows. So the record one goes to column one record two goes to column two record three goes to column 1 and so on

 

thank you for any help

<?php		  // Get buddies
$query_get_buddy = ("SELECT * from Buddylink WHERE owner_id = '$user_id' AND status = '2'");
$get_buddy = mysql_query($query_get_buddy)or die("SQL Error: $query_get_buddy<br>" . mysql_error());

 while ($buddy = mysql_fetch_assoc($get_buddy)){

$buddy_id = $buddy['buddy_id'];

$query_buddy_albums = ("SELECT * FROM albumNames WHERE user_id = '$buddy_id'");
$buddy_album = mysql_query($query_buddy_albums)or die("SQL Error: $query_buddy_albums<br>" . mysql_error());

while($album = mysql_fetch_assoc($buddy_album)){

?>		  
		  <div class="boxContainerLeft">
		  
		  </div>
		  
		  	<div class="boxContainerRight">
		  	
			</div>
	<?php }
}?>

Link to comment
https://forums.phpfreaks.com/topic/60669-solved-print-alternate-rows/
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.