I am trying to make a simple registration form (which does not need to be too secure, as its just to see who is participating.) However, whatever I try to do, I keep getting 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 'from, email, phone, accommodation, nights, room, talk, comments, pass) VALUES ' at line 1
Code:
mysql_query("INSERT INTO participants (name, from, email, phone, accommodation, nights, room, talk, comments, pass) VALUES
('$name', '$from', '$email', '$phone', '$accommodation', '$nights', '$room', '$talk', '$comments', '$pass')") or die(mysql_error());
Any ideas?
try this
mysql_query("INSERT INTO participants (name, from, email, phone, accommodation, nights, room, talk, comments, pass) VALUES
($name, $from, $email, $phone, $accommodation, $nights, $room, $talk, $comments, $pass)") or die(mysql_error());
but..
FROM
it is reserve word..
Reserved Words
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.