Go Back   CodingForums.com > :: Server side development > MySQL

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-09-2005, 01:01 PM   PM User | #1
crmpicco
Senior Coder

 
crmpicco's Avatar
 
Join Date: Jan 2005
Location: Mauchline, Scotland
Posts: 1,091
Thanks: 15
Thanked 1 Time in 1 Post
crmpicco has a little shameless behaviour in the past
Thumbs down search table for apostrophe

Code:
SELECT * FROM `dbo_tp_countryname` where CountryName like  '%'''%'
How do i search a table which has a apostrophe in it? I have tried the above, but it doesnt work.

My error is
Error: You have mismatched `'`
crmpicco is offline   Reply With Quote
Old 08-09-2005, 07:56 PM   PM User | #2
Kid Charming
Regular Coder

 
Join Date: Jun 2005
Posts: 804
Thanks: 0
Thanked 0 Times in 0 Posts
Kid Charming is an unknown quantity at this point
You need to escape the apostrophe you're searching for:

Code:
SELECT
 foo
FROM
 table
WHERE
 bar LIKE '%\'%'
Kid Charming is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:50 PM.


Advertisement
Log in to turn off these ads.