[Solved] “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 ‘1’ at line 1” [duplicate]


The error is coming from this line:

$sql1 = mysql_query($sql_1) or die(mysql_error());

$sql_1 is not a query, it’s the return value from another call to mysql_query.

$sql_1 = mysql_query("insert into `student_invoice` set ProfileID = '".$_SESSION["stud_id"]."' , Inv_No = '".$today = date("M-Y")."-".$checkvalu."', Inv_Date="".$_POST["TXNDATE"]."", Inv_Order="".$_POST["ORDERID"]."" ") or die(mysql_error());

Remove this line from the script:

$sql1 = mysql_query($sql_1) or die(mysql_error());

It doesn’t do anything useful.

3

solved “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 ‘1’ at line 1” [duplicate]