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 Quote Link to comment 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 Quote Link to comment 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. Quote Link to comment 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 . . . Quote Link to comment 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. 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.