php - Very simple MySQL query not working -
i'm trying execute this:
$result = mysql_query("insert timesheet (project_no,user,cust_name,notes,duration) values("'".$_post['project']."', '".$_post['user']."', '".$_post['cust']."', '".$_post['notes']."', '".$_post['duration']."'")") or die(mysql_error());
i'm aware of sql injection. can spot issues apostrophes, speech marks etc??
the apostrophes not correct.
$result = mysql_query("insert timesheet (project_no,user,cust_name,notes,duration) values('".$_post['project']."', '".$_post['user']."', '".$_post['cust']."', '".$_post['notes']."', '".$_post['duration']."')") or die(mysql_error());
the mistake in beginning in "values" , on closing bracket inside query string. use editor syntax highlighting, would've showed problem.
Comments
Post a Comment