niche Posted May 12, 2010 Share Posted May 12, 2010 Why are my prices on top of my table?$.25$1.00$2.00Company Item PriceCompany A Product BCompany B Product BCompany C Product CMy script: <?phpinclude_once "connect_to_mysql.php";$result = mysql_query("SELECT * FROM clioff") or die(mysql_error()); echo "<table border='1'>";echo "<tr> <th>Company</th> <th>Item</th> <th>Price</th></tr>";// keeps getting the next row until there are no more to getwhile($row = mysql_fetch_array( $result )) { // Print out the contents of each row into a table echo "<tr><td>"; echo $row['client']; echo "</td><td>"; echo $row['item']; echo "</td></tr>"; echo $row['price']; echo "</td></tr>"; } echo "</table>";?> Link to comment Share on other sites More sharing options...
thescientist Posted May 12, 2010 Share Posted May 12, 2010 I think you closed the <tr> tag too soon; on the line after you echo $row['item']; Link to comment Share on other sites More sharing options...
niche Posted May 12, 2010 Author Share Posted May 12, 2010 Thanks to thescientist.Niche Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.