I am doing an insertion operation in PHP using functions. The error seems very trivial but i couldn't identify its source.
<?php
class DB_Insert{
public function insertLec($lecId,$csId,$date,$time,$update,$export)
{
$con=mysql_connect("localhost","root","");
mysql_select_db("attenmandb");
$retval=mysql_query("INSERT INTO lecturetb(LecID, CSID, Date, Time, Updation, Export) VALUES($lecId,'$csId','$date','$time','$update','$export')",$con);
if(! $retval)
{
echo 'ERROR!';
}
else
{
echo 'Success';
}
}
$this->insertLec(1,'CST5','27-9-2014','11.30 to 12.30','No','No');
}
?>
Error looks like this:
Parse error: syntax error, unexpected T_VARIABLE, expecting T_FUNCTION in DB_Insert.php on line 20