I am trying to use a Php script to read information from a MySQL database and display it in an html table. For some reason, though, I keep getting the following error:
Parse error: parse error, unexpected T_STRING in /srv/www/htdocs/surveys/helpdesk/surveyresults.php on line 27
<html>
<head>
<title></title>
</head>
<body>
<?php
// Set the variables for database access
$User = "";
$Password = "";
$DBName = "";
$TableName = "";
$Link=mysql_connect (localhost, $User, $Password);
$Query="SELECT * from $TableName";
$Result="mysql_db_query ($DBName, $Query, $Link);
//Create a table for data
while ($Row=mysql_fetch_array ($Result)){
Line 27---> print ("<table border=1>\n");
print ("<TR>");
print ("<TD><B>Work Order #:</B></TD><TD align=center>$Row[wo]</td>\n");
print ("</TR>\n");
print ("<TR>\n");
print ("<TD><B>Technician:</B></TD><TD ALIGN=CENTER>$Row[technician]</TD>\n");
print ("</TR>\n");
print ("<TR>\n");
print ("<TD><B>Quality of service:</B></TD><TD ALIGN=CENTER>$Row[question1]</TD>\n");
print ("</TR>\n");
print ("<TR>\n");
print ("<TD ALIGN=RIGHT><B>Comments:</b></TD><TD>$Row[comments1]</TD>\n");
print ("</TR>\n");
print ("<TR>\n");
print ("<TD><B>Provided in a timely manner?</B></TD><TD ALIGN=CENTER>$Row[question2]</TD>\n");
print ("</TR>\n");
print ("<TR>\n");
print ("<TD ALIGN=RIGHT><B>Comments:</B></TD><TD>$Row[comments2]</Td>\n");
print ("</TR>\n");
print ("<TR>\n");
print ("<TD><B>Technician was helpful and professional?</B></TD><TD ALIGN=CENTER>$Row[question3]</TD>\n");
print ("</TR>\n");
print ("<TR>\n");
print ("<TD ALIGN=RIGHT><B>Comments:</B></TD><TD>$Row[comments3]</TD>\n");
print ("</TR>\n");
}
mysql_close ($Link);
print ("</TABLE>\n");
?>
</BODY>
</HTML>
I cannot figure out what is wrong with that line or why it does not like the "print" command???
I have a similar Php script that submits the info from an html form to the database and it works fine. I also use the "print" command in that script without any problems.
I'm stumped...
Vinny