...

View Full Version : insert into problem



mhunt
01-11-2007, 07:10 PM
Error I am recieving is :
#1064 - 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 '' at line 1
I think it's the place where phone2 should be but that is not a mandatory field so it can be blank but i don't think mysql wants to let me.


INSERT INTO students(organization_id, supervisor_id, fname, mi, lname, email, address1, address2, city, state, zipcode, phone1, phone2) VALUES('2', '4', 'John', 'A', 'Doe', 'john.a.doe@lmco.com', '1600 JFK Blvd', 'Suite 200', 'Philadelphia', 'PA', '19125', '215-455-8795', ''

StupidRalph
01-11-2007, 07:20 PM
What about the closing parenthesis?


INSERT INTO students(organization_id, supervisor_id, fname, mi, lname, email, address1, address2, city, state, zipcode, phone1, phone2) VALUES('2', '4', 'John', 'A', 'Doe', 'john.a.doe@lmco.com', '1600 JFK Blvd', 'Suite 200', 'Philadelphia', 'PA', '19125', '215-455-8795', '')

guelphdad
01-11-2007, 08:59 PM
Two other things to note

1) Don't enclose numeric data in quotes '1' is a string, while 1 is the number 1.

2) use NULL for the abscence of value and not and empty string ' '



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum