I have a php form that is telling me i have errors in my sql syntax upon submission, however I’m coming up blank as the same form and php works on another site, that is hosted through the same provider, however on a different server:
Here is some of the php (the suspected problem area):
$sql = mysql_query("INSERT INTO members (name, email, password, streetadd, city, state, zip, phone, ext)
VALUES('$name', '$email', '$password', '$streetadd', '$city', '$state', '$zip', '$phone', '$ext')")
or die (mysql_error());
$id = mysql_insert_id();
mkdir("members/$id", 0755);
If any more code is needed let me know; I’d appreciate it if someone could let me know where I am going wrong, perhaps my knowledge is becoming outdated and i need to relearn mysql and php, but I think this should be working.
You are missing a paranteses at the end after ‘$ext’:
Another thing is you could have one of these fields be a int or some other number and those quotes might be a problem. Post the tables shema if you want more help the query seems fine really.