imarockstar Posted November 10, 2008 Share Posted November 10, 2008 I have this page that displays 6 boxes of information to which is pulled from my sql database. This is working fine, however, I need to add a small piece of html code to the end of every 3 boxes to that the boxes will continue on the next line. the code that I need to add is <br class=clear>. This needs to go after every 3rd box. I am not sure on how to write this into my php .. here is the page to where you can see the boxes. http://74.55.14.226/~green/index.php here is my current code <?php // Retrieve data from database $sql="SELECT * FROM homeblocks"; $result=mysql_query($sql); // Start looping rows in mysql database. while($rows=mysql_fetch_array($result)){ ?> <div class='box boxpadright'> <h2 class='boxtitle'><? echo $rows['title']; ?></h2> <a href='<? echo $rows['link']; ?>'><? echo $rows['text']; ?></a> </div> <!-- box --> <? } mysql_close(); ?> basically I need the output to look like this .. box box box line break box box box thanks Link to comment https://forums.phpfreaks.com/topic/132144-sql-display-question/ Share on other sites More sharing options...
genericnumber1 Posted November 10, 2008 Share Posted November 10, 2008 http://www.phpfreaks.com/forums/index.php/topic,95426.msg1012535.html#new Link to comment https://forums.phpfreaks.com/topic/132144-sql-display-question/#findComment-686757 Share on other sites More sharing options...
imarockstar Posted November 10, 2008 Author Share Posted November 10, 2008 thanks .. I did see that .. I was just hoping that there was a way to do this to where I did not have to use tables ... b Link to comment https://forums.phpfreaks.com/topic/132144-sql-display-question/#findComment-686762 Share on other sites More sharing options...
genericnumber1 Posted November 10, 2008 Share Posted November 10, 2008 You can, just adapt the methodology, crayonviolet's is a bit easier to adapt because it's cleaner. Post here with any questions you may have. Link to comment https://forums.phpfreaks.com/topic/132144-sql-display-question/#findComment-686829 Share on other sites More sharing options...
premiso Posted November 10, 2008 Share Posted November 10, 2008 A side note, tables are a thing of the past with this new "Web 2.0" The only issue with Web 2.0 and why tables are still used today is because of compatibility. Tables will display how they should on any browser, using CSS to design a site say in Firefox will look differently in IE. Mainly because IE thinks that it can use it's own rules. It is nearly impossible to get both of them to work, it takes alot of different hacks etc to make them look right and if you do not know which browser does it, it is near impossible. I prefer to use CSS to design my tables, but man it is a pain to get working across with IE having it's own rules and not wanting or going to change that. Link to comment https://forums.phpfreaks.com/topic/132144-sql-display-question/#findComment-686833 Share on other sites More sharing options...
genericnumber1 Posted November 10, 2008 Share Posted November 10, 2008 I disagree, tables should be used for tabular data. Not using tables for tabular data is like trying to stack non-bold text in such a way as to make it appear bold. Yes, you can do it, but why do it that way if there's already a method made to do it easily. Of course you shouldn't use tables for layouts, that's a given, but people who say you should never ever use tables under any circumstances either don't know what they're doing, they're misinformed, or they're a masochist. Link to comment https://forums.phpfreaks.com/topic/132144-sql-display-question/#findComment-686869 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.