blade_922 Posted September 15, 2006 Share Posted September 15, 2006 Firstly the PHP Code[code]<table class='tablefull' ><?php$hotmain=mysql_query("select * from mos_content ORDER BY 'mainhot' DESC LIMIT 2 ") or die(mysql_error());while ($donnee = mysql_fetch_array($hotmain)){ $title= $donnee['title']; $introtext=$donnee['introtext'];$author=$donnee['created_by']; $sectionid=$donnee['sectionid']; $displayhot=$donnee['displayhot'];$mainhot=$donnee['mainhot'];$mainhot_img=$donnee['mainhot_img'];if ($mainhot==1){echo "<tr><td id='maintitle'> EXCLUSIVE </td></tr>";echo " <tr><td id='image'> <center> <a href='http://www.pspcave.com/'> <img src='$mainhot_img'></a></center></td></tr>";echo "<tr><td id='articletitle'><center><a href='http://www.pspcave.com/'>";echo $title;echo "</a></center></td></tr>";}}?></table>[/code]Ok so now the problem. This code manages to display 2 x the result since i set the Limit to 2. But it displays it one on top of each other, vertically.Like[result1][result2]But i want it to display it horizontally, side by sidelike[result1] [result2]I know the <td> and <tr> tags should be changed. but i have been sitting around messing around with them but have no idea how to do it to display correct.Regards Quote Link to comment https://forums.phpfreaks.com/topic/20910-displaying-results-horizontally-instead-of-vertically/ Share on other sites More sharing options...
HuggieBear Posted September 15, 2006 Share Posted September 15, 2006 It's possible, but not very easy.I think I have some code somewhere I picked up recently that does it.I'll look and post if I find it.Huggie Quote Link to comment https://forums.phpfreaks.com/topic/20910-displaying-results-horizontally-instead-of-vertically/#findComment-92628 Share on other sites More sharing options...
freakus_maximus Posted September 15, 2006 Share Posted September 15, 2006 Check out the Code Snippet forum here -> [url=http://www.phpfreaks.com/forums/index.php/topic,95426.0.html]http://www.phpfreaks.com/forums/index.php/topic,95426.0.html[/url]It explains how to do multicolumn displays. Quote Link to comment https://forums.phpfreaks.com/topic/20910-displaying-results-horizontally-instead-of-vertically/#findComment-92632 Share on other sites More sharing options...
HuggieBear Posted September 15, 2006 Share Posted September 15, 2006 OK, so that code wasn't hard at all... My bad.I was thinking of something completely different. Multiple columns but still with results going vertically, like this:[code]|---|---|| 1 | 4 ||---|---|| 2 | 5 ||---|---|| 3 | 6 ||---|---|[/code]Over complicating things again :)Huggie Quote Link to comment https://forums.phpfreaks.com/topic/20910-displaying-results-horizontally-instead-of-vertically/#findComment-92661 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.