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? 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 ? 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 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 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 Link to comment https://forums.phpfreaks.com/topic/221691-struggling-with-simple-columns/#findComment-1147535 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.