Hey guys, for some reason, I can't get this to work, basically its just a table that gets data-from a database, and displays it in the table, now the error I get is:
Parse error: parse error, unexpected T_STRING in c:\program
files\apache group\apache\htdocs\displaydb.php on line 17
So naturally I check line 17, I can't see anything wrong with it, do you?
Now, the file is DisplayDB.php, and the code for it is below
<HTML>
<HEAD>
<Title>Retrieving Data From a Database</title>
<BODY>
<?php
//Set the variables for the database access:
$Host = "localhost";
$DBName = "New";
$TableName = "Feedback";
$Link = mysql_connect($Host);
$Query = "SELECT * from $TableName;
$Result = mysql_db_query($DBName, $Query, $Link);
//Create a table.
print("<TABLE BORDER=1 WIDTH=\"75%\"
CELLSPACING=2 CELLPADDING=2
ALIGN=CENTER>\n");
print("<TR ALIGN=CENTER
VALIGN=TOP>\n");
print ("<TD ALIGN=CENTER
VALIGN=TOP>Name</TD>\n");
print ("<TD ALIGN=CENTER
VALIGN=TOP>Email Address</td>\n");
print ("<TD ALIGN=CENTER
VALIGN=TOP>Comments</td>\n");
print ("</TR>\n");
// Fetch the results from the database.
while ($Row = mysql_fetch_array
($Result)) {
print ("<TR ALIGN=CENTER
VALIGN=TOP\n");
print ("<TD ALIGN=CENTER
VALIGN=TOP>$Row[FirstName]
$Row[LastName]</TD>\n");
print ("TD ALIGN=CENTER VALIGN=TOP
$Row[EmailAddress]</TD>\n");
print ("<TD ALIGN=CENTER
VALIGN=TOP>$Row[Comments]</TD>\n");
print ("<TR>\n");
}
mysql_close($Link);
print ("<TABLE>\n");
?>
</BODY>
</HTML>