Hi guys! I know this shouldnt happen but ive got a mysql error but only in google chrome and I presume safari. Its strange because the page shows correctly in all browsers despite the error :s here is the 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 '(email, password, first, sur, contact) VALUES ('','d41d8cd98f00b204e9800998ecf84' at line 1 email should have a value going into it as well. This error is only seen in the source on chrome but not in the ie ff source. And the values go into the table as well. Any ideas how to fix this? Ive echoed the email address to screen and it is their. insert code: mysql_query("INSERT INTO $_POST[table] (email, password, first, sur, contact) VALUES ('$_POST','".md5($_POST['pass'])."','$_POST[first]','$_POST[sur]','$_POST[contact]')")or die(mysql_error()); Any help? Cheers, J
You miss some single quote ( ' ) when using $_POST[table]. It should be $_POST['table']. the same apply to the others variable.
it works the same with or without. either way the data does get inserted. I initially had the (') in with the same effect. Any other suggestions?
bl4ckwolf has given a good suggestion. That is the correct way doing it. Anyways, value for email is not being passed on submit button. Are you using some kind of javascript or something like that?
There is unrelated javascript on the page. The value is there for ie but not chrome but both browsers echo the email account to the screen.
Can you please put the echo statement before firing the sql query ... and paste it here the result of echo statement