PHP parse error
Posted: Sun Jul 20, 2003 7:45 am
I got this error from a file I am trying to get to work:
Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /Users/helen/Sites/trreport.php on line 4
Here is my code. Could anyone please tell me what is wrong? I want to use this with an html form (obviously). Should this be embedded into the html or as a separate file?
<?
$db =mysql_connect ("localhost" ,"root" ,"blah" );
mysql_select_db (csttrrep);
$result =mysql_query ("INSERT INTO repinfo (empID, firstName, lastName, location, district, courseName, instructor, date, duration)
VALUES ('$empID', '$firstName', '$lastName', '$location', '$district', '$courseName', '$instructor', '$date', '$duration')" );
if(! $result )
{
echo "<b>Something not added:</b> " ,mysql_error ();
exit;
}
if( $result )
{
mysql_close ($db );
print "Something added sucessfully!" ;
}
?>
Thanks in advance!
Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /Users/helen/Sites/trreport.php on line 4
Here is my code. Could anyone please tell me what is wrong? I want to use this with an html form (obviously). Should this be embedded into the html or as a separate file?
<?
$db =mysql_connect ("localhost" ,"root" ,"blah" );
mysql_select_db (csttrrep);
$result =mysql_query ("INSERT INTO repinfo (empID, firstName, lastName, location, district, courseName, instructor, date, duration)
VALUES ('$empID', '$firstName', '$lastName', '$location', '$district', '$courseName', '$instructor', '$date', '$duration')" );
if(! $result )
{
echo "<b>Something not added:</b> " ,mysql_error ();
exit;
}
if( $result )
{
mysql_close ($db );
print "Something added sucessfully!" ;
}
?>
Thanks in advance!