warstormer Posted August 6, 2007 Share Posted August 6, 2007 I'm getting this error at the mo... not overly useful... Is there a problem with the @ symbol? 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 '@hotmail.com' at line 1 Quote Link to comment https://forums.phpfreaks.com/topic/63515-solved-you-have-an-error-in-your-sql-syntax-symbol/ Share on other sites More sharing options...
trq Posted August 6, 2007 Share Posted August 6, 2007 Post your query. Quote Link to comment https://forums.phpfreaks.com/topic/63515-solved-you-have-an-error-in-your-sql-syntax-symbol/#findComment-316554 Share on other sites More sharing options...
warstormer Posted August 6, 2007 Author Share Posted August 6, 2007 Here's the query... mysql_query("INSERT INTO wholesale_tbl (wholesale_id, wholesale_name, wholesale_forename, wholesale_company, wholesale_add1, wholesale_add2, wholesale_add3, wholesale_city, wholesale_zip, wholesale_country, wholesale_tel, wholesale_fax, wholesale_email) VALUES ($password, $name, $forename, $company, $add1, $add2, $add3, $city, $zip, $country, $tel, $fax, $from") or die(mysql_error()); The variables are from a form... Quote Link to comment https://forums.phpfreaks.com/topic/63515-solved-you-have-an-error-in-your-sql-syntax-symbol/#findComment-316555 Share on other sites More sharing options...
Crew-Portal Posted August 6, 2007 Share Posted August 6, 2007 Not sure maybe youll get an error but it will let you through if you put mysql_query("INSERT INTO wholesale_tbl (wholesale_id, wholesale_name, wholesale_forename, wholesale_company, wholesale_add1, wholesale_add2, wholesale_add3, wholesale_city, wholesale_zip, wholesale_country, wholesale_tel, wholesale_fax, wholesale_email) VALUES ($password, $name, $forename, $company, $add1, $add2, $add3, $city, $zip, $country, $tel, $fax, $from") or echo(mysql_error()); And if you want to bypass the errors and let it still post try: mysql_query("INSERT INTO wholesale_tbl (wholesale_id, wholesale_name, wholesale_forename, wholesale_company, wholesale_add1, wholesale_add2, wholesale_add3, wholesale_city, wholesale_zip, wholesale_country, wholesale_tel, wholesale_fax, wholesale_email) VALUES ($password, $name, $forename, $company, $add1, $add2, $add3, $city, $zip, $country, $tel, $fax, $from"); This should work? Maybe? Quote Link to comment https://forums.phpfreaks.com/topic/63515-solved-you-have-an-error-in-your-sql-syntax-symbol/#findComment-316627 Share on other sites More sharing options...
trq Posted August 6, 2007 Share Posted August 6, 2007 String values need to be surounded in quotes. eg; INSERT INTO tbl (fld1,fld2) VALUES ('$var1',$var2'); Quote Link to comment https://forums.phpfreaks.com/topic/63515-solved-you-have-an-error-in-your-sql-syntax-symbol/#findComment-316684 Share on other sites More sharing options...
warstormer Posted August 13, 2007 Author Share Posted August 13, 2007 Thanks guys.... the quotes seemed to sort it.... Quote Link to comment https://forums.phpfreaks.com/topic/63515-solved-you-have-an-error-in-your-sql-syntax-symbol/#findComment-322509 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.