Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

mysql help

 
Jardel Tan
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
i would like to know how to insert a statement like
"i'm " into mysql table
insert into table values ('I'm')
 
Yogen Vadnere
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please try following....
insert into table values ('I''m')
 
kim jungil
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Jardel Tan:
hi
i would like to know how to insert a statement like
"i'm " into mysql table
insert into table values ('I'm')

you can try like this 'I\'m'
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A third way (and definitely my favourite) use PreparedStatements - this lets each database driver type take care of the specifics for escaping data.

Dave
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic