943,177 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Marked Solved
  • Views: 19
  • PHP RSS
Sep 1st, 2010
0

Looking for help on output rows in a table

Expand Post »
Good Evening,

I have a table that has a field with 15 entrys in it. I would like to output it from a query in a table that has 3 rows of 5. However, whenever I put a <tr> inside the loop, I get 15 rows. Any idea how I can get it to do three rows of 5.

X X X X X
X X X X X
X X X X X

PHP Syntax (Toggle Plain Text)
  1. <?php
  2. $result = mysql_query("SELECT bull FROM draftpick_grid order by bull ASC")
  3. or die(mysql_error());
  4.  
  5. echo "<tr>
  6. <tr bgcolor='000000'>
  7. <td colspan='100%' align='center' width='150'><img src='/images/bar_bull.jpg' width='150' height='19' border='0'></td>
  8. <tr>
  9.  
  10. ";
  11.  
  12. // keeps getting the next row until there are no more to get
  13. while($row = mysql_fetch_array( $result )) {
  14. // Print out the contents of each row into a table
  15.  
  16.  
  17.  
  18. echo "<tr><td width='30' align='center' bgcolor='FFFFFF'><font face='arial' size='1' color='000000'>";
  19. echo "<img src='/images/".$row['bull'].".jpg' width='28' height='28' alt='Bulldogs'>";
  20.  
  21.  
  22. }
  23.  
  24.  
  25. echo "</td></table>";
  26. ?>

The above code gives me 15 rows....if I take out the <tr> I get one row of 15. I want 3 rows of 5. Anyone?
Similar Threads
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
ceeandcee is offline Offline
72 posts
since Aug 2010
Sep 1st, 2010
0
Re: Looking for help on output rows in a table
Disregard. I got it to work!
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
ceeandcee is offline Offline
72 posts
since Aug 2010

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Quick question about form input?
Next Thread in PHP Forum Timeline: How to stop sending data on refresh





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC