-2

Thank you for your comments on this error

INSERT INTO donors ( 
    'institution', 
    'contact_person', 
    'first_name', 
    'last_name', 
    'affiliation'‎, 
    'picture_link', 
    'email', 
    'birthday', 
    'sex', 
    'street', 
    'city', 
    'state', 
    'zip'
) 
VALUES (
    '', 
    '', 
    'Claire', 
    'Bowens', 
    'employee', 
    'http://las-americas.org/wp-content/uploads/2010/10/Claire-staff-photo.jpg', 
    '@', 
    'yyyy-mm-dd', 
    'female', 
    '', 
    'El Paso', 
    'Texas', 
    '' 
)

Error: 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 ''institution', 'contact_person', 'first_name', 'last_name', 'affiliation'‎, 'p' at line 1

Mr. Radical
  • 1,847
  • 1
  • 19
  • 29

2 Answers2

1

To enclose identifiers use backticks => `` `

In your code you used '.

INSERT INTO donors ( `institution`, `contact_person`, `first_name`, `last_name`, `affiliation`?, `picture_link`, `email`, `birthday`, `sex`, `street`, `city`, `state`, `zip`) VALUES ('', '', 'Claire', 'Bowens', 'employee', 'http://las-americas.org/wp-content/uploads/2010/10/Claire-staff-photo.jpg', '@', 'yyyy-mm-dd', 'female', '', 'El Paso', 'Texas', '' )

(Single) Quotes are just used for string literals.

A more detailed answer can be found in this question:

Community
  • 1
  • 1
Sirko
  • 72,589
  • 19
  • 149
  • 183
0

remove the ' from your table fields like this.

INSERT INTO donors ( 
    institution, 
    contact_person, 
    first_name, 
    last_name, 
    affiliation‎, 
    picture_link, 
    email, 
    birthday, 
    sex, 
    street, 
    city, 
    state, 
    zip
) 
VALUES (
    '', 
    '', 
    'Claire', 
    'Bowens', 
    'employee', 
    'http://las-americas.org/wp-content/uploads/2010/10/Claire-staff-photo.jpg', 
    '@', 
    'yyyy-mm-dd', 
    'female', 
    '', 
    'El Paso', 
    'Texas', 
    '' 
)
ESC
  • 31
  • 4