• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SQL quotation question

 
Werner Fletcher
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey all,

I'm trying to insert this into a table from the MySQL command line: Quote for the day: "bla bla bla"
This is the line I'm using: INSERT INTO table VALUES('Quote for the day: '"bla bla bla"'');

This is not working for me... any help?

Thanks
 
Werner Fletcher
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, I accidentally clicked the freaking "Solved" button

What I mean is that I'm not getting the " " around my quote.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34218
341
Eclipse IDE Java VI Editor
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't worry about the solved button.

It looks like you have nested single quotes. You need to escape them so the database can see them. In most databases, you write the ' symbol an extra time.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic