Jump to content

MySQL Error


topflight

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/127069-mysql-error/
Share on other sites

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 _.

Link to comment
https://forums.phpfreaks.com/topic/127069-mysql-error/#findComment-657310
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.