When I execute:
mysql_query("SELECT * FROM people WHERE fname = '$fname'; INSERT INTO people (first_name) VALUES ('$fname')") or die(mysql_error());
I receive this 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 'INSERT INTO people (first_name) VALUES ('Draski')' at line 1
Where is the syntax error?
mysql_query()
, not multiple. So, make it different function calls. Also,mysql_
is deprecated, for new code, please usemysqli_
orPDO
.