MySQL Forums
Forum List  »  PHP

Re: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to****
Posted by: Peter Brawley
Date: December 10, 2013 03:33AM

"Guys"?

Dumping the whole PHP script doesn't help anyone understand the cause of a MySQL syntax error.

The way to find the cause of such errors, as Rick says, is to put it into a variable, echo the var to the screen, then study the query till you find the error ...

$qry = "INSERT INTO tbl_student_master
(lastname,firstname,middlename,birthdate,nationality,weight,height,agent,mother,father,cellno,email,hair,complexion,vitalstat,address,civil,password)
values
('$lastname','$firstname','$middlename','$birthdate','$nationality','$weight','$height','$agent','$mother','$father','$cell','$email','$hair',
'$complexion','$vital','$address','$civilstat','$r')";
echo $qry;

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.