gilbertsavier Posted July 31, 2009 Report Share Posted July 31, 2009 Hi, Going to try to explain this as best I can. I have a bunch of stuff in a database and I need to display this info within a table. This isn't a problem at all but, I need it to only display 3 td tags per line and then move on to the row. so i need it to do : code: My First RowMy First Row 2My First Row 3 My Second RowMy Second Row 2My Second Row 3 and continue to do this through every entry in the database table. so I have something like this that will display the info: code: for ($i = 1; $i <= $num; $i++){ $chairArray = mysql_fetch_array($chairResult); $chairName = $chairArray['name']; $chairDescription = $chairArray['description']; $chairImage = $chairArray['image']; echo " echo ""; echo ""; echo " "; echo $chairName; echo ""; echo ""; } ------------------------------------ Thanks & regards Lokananth Quote Link to comment Share on other sites More sharing options...
administrator Posted August 1, 2009 Report Share Posted August 1, 2009 "I need it to only display 3 td tags per line and then move on to the row." This is bound by the recordset you are pulling from the database - each loop allows you to print out one record from MySQL. So if your record is made up of three columns/fields you will get three pairs. Does this make sense? Quote Link to comment Share on other sites More sharing options...
bishwadeep Posted August 18, 2009 Report Share Posted August 18, 2009 (edited) Hi gilbertsavier, Is this what you need? > </pre> <table width="100%"><?=$rs['name']?><?=$rs['address']?><?=$rs['phone']?></table> Edited August 19, 2009 by bishwadeep Quote Link to comment 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.
Note: Your post will require moderator approval before it will be visible.