Jump to content

While Loop, 6 Rows Then Start New Column


jigsawsoul

Recommended Posts

How can i get the while loop to display six rows then create a new column and six etc and so on... i can't seem to get this to work any help would be great?  :confused:

 

$result = "SELECT * FROM uses";

$result = mysql_query ($result) or die (mysql_error());

while($row = mysql_fetch_assoc($result)) 
{	

	$js .= ''.$row['js'].'';

	$table .= '	
			<td>
      				<a id="'.$row['id'].'" href="#" title="'.$row['uses'].'">Usage</a>
    			</td>
    			';
 }

 

<table id='gravity' cellspacing='5'>
  <tr>
	<?php echo $table ?>
  </tr>
</table>

 

Link to comment
https://forums.phpfreaks.com/topic/199487-while-loop-6-rows-then-start-new-column/
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.