Rifts Posted December 14, 2010 Share Posted December 14, 2010 I can not figure this out... <?php include 'include/config.php'; $sql = mysql_query(" SELECT * FROM logos "); while($row = mysql_fetch_assoc($sql)) { echo $row['image']; echo "<br />"; } ?> now that is printing a nice list now how can I just split it into two columns? Quote Link to comment https://forums.phpfreaks.com/topic/221691-struggling-with-simple-columns/ Share on other sites More sharing options...
.josh Posted December 15, 2010 Share Posted December 15, 2010 1 2 3 4 5 6 or 1 4 2 5 3 6 ? Quote Link to comment https://forums.phpfreaks.com/topic/221691-struggling-with-simple-columns/#findComment-1147444 Share on other sites More sharing options...
mikecampbell Posted December 15, 2010 Share Posted December 15, 2010 You could try adapting this function: http://www.exorithm.com/algorithm/view/multicolumn Quote Link to comment https://forums.phpfreaks.com/topic/221691-struggling-with-simple-columns/#findComment-1147449 Share on other sites More sharing options...
Rifts Posted December 15, 2010 Author Share Posted December 15, 2010 1 2 3 4 5 6 or 1 4 2 5 3 6 ? doesnt matter Quote Link to comment https://forums.phpfreaks.com/topic/221691-struggling-with-simple-columns/#findComment-1147523 Share on other sites More sharing options...
BK87 Posted December 15, 2010 Share Posted December 15, 2010 <?php include 'include/config.php'; $sql = mysql_query(" SELECT * FROM logos "); while($row = mysql_fetch_assoc($sql)) { echo $row['image']; if($i%2==0){ echo " "; }else{ echo "<br />"; } $i++; } ?> not tested. but should work Quote Link to comment https://forums.phpfreaks.com/topic/221691-struggling-with-simple-columns/#findComment-1147535 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.