Jump to content

Displaying a PHP/MYSQL Table - Error?


colleyboy

Recommended Posts

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 :D

 

Ian

Link to comment
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.