Q:

inserting values using get method into database

i am relatively new in php.The problem that i am facing while i inserting values into 'leave' table of  my database. the error is given below..
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 'where lid = 4' at line 1
and here is my code
<?php

include_once 'config.php';
$accept = "accepted";
mysql_query("insert into `leave` (`action`) values ('$accept') where lid =           ".$_GET['id'] , $dbCon ) or die(mysql_error());  

header('location: admin_leave.php'); 
?>

A:

You need to use update for this not insert 
mysql_query("update leave set `action` ='$accept' where lid = ".$_GET['id'] , $dbCon ) or die(mysql_error()); 

and don't use mysql_* they are depreciated link: http://php.net/manual/en/function.mysql-db-query.php . Use either PDO/mysqli

