I am writing insert query in php file but it is giving error. I explain my problem.
I am wriitng such code in a php file
$sqlquery = "insert into leave (session_id,empid,leave,year) values('$_SESSION[id]', '$_SESSION[empid]', '$_POST[leavenum]', '$_POST[year]')";
$res = mysql_query($sqlquery,$link) or die('Error: ' . mysql_error());
after that problem is it is showing this error in this page
Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'leave (session_id,empid,leave,year) values('20202', 'DTL0009', '12', '2010')' at line 1
How i can solve this problem . Please help me . It is very urgent for me.