colleyboy Posted September 16, 2010 Share Posted September 16, 2010 Hi, I am trying to array a mysql tables data into a php table. Not having luck... <?php include('dbconnect.php') ?> <?php // Make a MySQL Connection $query = "SELECT * FROM cars"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)){ echo $row['CarName']. " - ". $row['CarTitle']; echo "<br />"; echo "<TABLE CELLPADDING=0 CELLSPACING=0 WIDTH=100%>"; echo "<TR />"; echo "<TD />"; echo $row['CarName'].; echo "</TD>"; echo "<TD />"; echo $row['CarTitle'].; echo "</TD>"; echo "</TR>"; echo "</TABLE>"; } ?> Error says: Parse error: syntax error, unexpected ';' in /home/wormste1/public_html/tilburywebdesign/shop/FTPServers/barryottley/viewcars.php on line 69 echo </TD /> is line 69. Please help Ian Link to comment https://forums.phpfreaks.com/topic/213604-displaying-a-phpmysql-table-error/ Share on other sites More sharing options...
Pikachu2000 Posted September 16, 2010 Share Posted September 16, 2010 If you're trying to display a literal decimal or period, you need to quote it and concatenate it to the variable, otherwise it can just go away . . . echo $row['CarName'].; // <-- HERE echo "</TD>"; echo "<TD />"; echo $row['CarTitle'].; // <-- AND HERE Link to comment https://forums.phpfreaks.com/topic/213604-displaying-a-phpmysql-table-error/#findComment-1111803 Share on other sites More sharing options...
Miss_Rebelx Posted September 16, 2010 Share Posted September 16, 2010 oy! you beat me to it as I went to test it out first! Anyways, you said: echo </TD /> is line 69 According to what you pasted to us, there is no such line in your code. Though, what was said above me will fix that error. Link to comment https://forums.phpfreaks.com/topic/213604-displaying-a-phpmysql-table-error/#findComment-1111811 Share on other sites More sharing options...
Pikachu2000 Posted September 16, 2010 Share Posted September 16, 2010 oy! you beat me to it as I went to test it out first! Anyways, you said: echo </TD /> is line 69 According to what you pasted to us, there is no such line in your code. Though, what was said above me will fix that error. Well, now that you mention it, <TR /> and <TD /> aren't valid syntax. <tr></tr> and <td></td> are valid . . . Link to comment https://forums.phpfreaks.com/topic/213604-displaying-a-phpmysql-table-error/#findComment-1111814 Share on other sites More sharing options...
Miss_Rebelx Posted September 16, 2010 Share Posted September 16, 2010 Indeed. Though I was kind of hoping some weird concatenation between one of his </TD> and one of his <TD /> was going on! That'd be entertaining. Link to comment https://forums.phpfreaks.com/topic/213604-displaying-a-phpmysql-table-error/#findComment-1111817 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.