If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Syntax error Insert INTO

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-26-10, 05:15
mo555 mo555 is offline
Registered User
 
Join Date: Sep 2010
Posts: 2
Thumbs down Syntax error Insert INTO

qrybiology.Close;
qryBiology.SQL.Clear;
qrybiology.active:=false;
qrybiology.SQL.add('INSERT INTO tblstudents(username,Password,sName,sSurname,Cellp hone,Grade)'+
' VALUES ('''+ edtnewusername.Text + ''','''+ edtnewpass.Text + ''','''+ edtname.Text + ''','''+ edtsurname.Text + ''','''+ edtcell.Text + ''','''+ edtgrade.Text + ''')');

qrybiology.ExecSQL;
qrybiology.active:=true;

i receive a syntax error in the INSERT INTO statement... please advise...
Reply With Quote
  #2 (permalink)  
Old 09-26-10, 07:19
it-iss.com it-iss.com is offline
Registered User
 
Join Date: Sep 2009
Location: San Sebastian, Spain
Posts: 620
Hi,

the code

Code:
qrybiology.SQL.add('INSERT INTO tblstudents(username,Password,sName,sSurname,Cellp hone,Grade)'+
' VALUES ('''+ edtnewusername.Text + ''','''+ edtnewpass.Text + ''','''+ edtname.Text + ''','''+ edtsurname.Text + ''','''+ edtcell.Text + ''','''+ edtgrade.Text + ''')');
Are you sure about the "Cellp hone". This might be Cellphone?
__________________
Ronan Cashell
Senior Oracle/MySQL DBA
http://www.it-iss.com
Reply With Quote
  #3 (permalink)  
Old 09-30-10, 23:23
Tharaka Deshan Tharaka Deshan is offline
Registered User
 
Join Date: Sep 2010
Posts: 1
Talking Field Name

Yeah, "Cellp hone" is the only case I got as a problem.
MySql allows spaces in field names.But I hope you had not do so.
So it may be a printing mistake.
Good Luck!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On