topflight Posted October 5, 2008 Share Posted October 5, 2008 Hi I am trying to insert information into the database and I am receiving the following message: 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 'Manager,Fleet Manager,Events Director,hr,bm,appdate,ip) VALUES ('','','','','','' at line 1 $insert = mysql_query("INSERT INTO `pilots` (login,fname,lname,email,vatsimid,hub,hours,hoursc,password,rank,status, Hub Manager,Fleet Manager,Events Director,hr,bm,appdate,ip) VALUES ('$login','$_POST[fname]','$_POST[lname]','$_POST','$_POST[vatsimid]','$_POST[hub]','$_POST[hours]','$_POST[hoursc]','$_POST[password]','First Officer','0','0','0','0','0','$now','$ip')") or die(mysql_error()); echo "<b><center>APPLICATION SENT TO DATABASE YOU WILL RECCEVIE AN EMAIL SHORTLY</b><</center>";} That is just the insert portion of the code. Thanks in advanced Quote Link to comment https://forums.phpfreaks.com/topic/127069-mysql-error/ Share on other sites More sharing options...
Maq Posted October 5, 2008 Share Posted October 5, 2008 It's because you are telling mysql to insert for 18 fields when you only have 17 values to put in. Basically you need another value. Quote Link to comment https://forums.phpfreaks.com/topic/127069-mysql-error/#findComment-657308 Share on other sites More sharing options...
PFMaBiSmAd Posted October 5, 2008 Share Posted October 5, 2008 That would result in a different error message. The column names - Hub Manager,Fleet Manager, and Events Director contain spaces and require special handling. The recommend method would be for you to rename those to remove the space. I recommend changing the space to an underscore _. Quote Link to comment https://forums.phpfreaks.com/topic/127069-mysql-error/#findComment-657310 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.