Image

Imageadcott wrote in Imagewebdev beer

Listens: Hot Hot Heat - Bandages

I maintain this tool which displays a list of syndicated feeds on LiveJournal, it's a very simple operation using PHP and MySQL.

Today I hit my first snag, for the first time ever the database update script choked... on Imagetimoreilly. Upon closer inspection I discovered it was due to an apostrophe in the feed URL which was in turn breaking the MySQL query.
The simple solution to this would be to escape any quotes before they get a chance to be inserted into the database, but I really don't want to do that because it would mean un-escaping them when I pull them back out (as to not break the link). I am trying to keep CPU usage to a minimum, I imagine running a string replace function a hundred times per page would not be a good thing.

Does anyone have any recommendations on how to fix this?

I've fixed it for now by editing the db by hand, but I'd rather not have to do that every time an apostrophe shows up in a feed URL.