Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I'm getting empty sets from running the following query permutations:

select * 
from gsapi_articles 
where article_title = "James Dean On Merilyn: 'This Woman Is A True Marvel'"

select * 
from gsapi_articles 
where article_title = "James Dean On Merilyn: \'This Woman Is A True Marvel\'"

Not sure whats wrong.

share|improve this question

closed as off-topic by Max Vernon, Paul White, RolandoMySQLDBA, Michael - sqlbot, Mark Storey-Smith Dec 2 '13 at 9:56

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Too localized - this could be because your code has a typo, basic error, or is not relevant to most of our audience. Consider revising your question so that it appeals to a broader audience. As it stands, the question is unlikely to help other users (regarding typo questions, see this meta question for background)." – Max Vernon, Paul White, RolandoMySQLDBA, Michael - sqlbot, Mark Storey-Smith
If this question can be reworded to fit the rules in the help center, please edit the question.

2  
-1 for presenting political views here, which is way off topic. Also, you could easily find the answer in the MySQL documentation here: dev.mysql.com/doc/refman/5.0/en/string-literals.html. –  Max Vernon Dec 1 '13 at 21:25

1 Answer 1

If you write your query in SQL you must doubled your ' in this way:

select * from gsapi_articles
where article_title = 'James Woods On Obama: ''This President Is A True Abomination'''
share|improve this answer
    
You can escape a single quote with \' in MySQL. You don't have to use '' –  ypercube Dec 1 '13 at 22:49

Not the answer you're looking for? Browse other questions tagged or ask your own question.