Quick PHP and/or MySQL question

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I'm developing something for a friend and for some reason, my mind has
gone wibble and I've forgotten something.

Point your browsers at and
you'll see it virtually instantly. Around the text in the first two
columns are quote marks.

I'm using PHP to access a MySQL database and I have a feeling the quotes
are part of the dataset imported. I either need to strip the quotes from
the SQL database *or* in the PHP. Question is, how do I do either of

All my books on this are at work. It's been a hectic weekend and my mind
is giving up. Help would be appreciated :-)


"Space", it says, "is big. Really big. You just won't believe how
vastly, hugely, mind-bogglingly big space really is. I mean, you may
think it's a long way down the road to the chemists, but that's just
*peanuts* compared to space, listen" - Hitch Hikers Guide to the Galaxy

Re: Quick PHP and/or MySQL question

Gazing into my crystal ball I observed "Paul F. Johnson" <paul@all-the-

Quoted text here. Click to load it

Single quotes are used in SQL statements as delimiters and must be escaped.    
I use a tilde mark, and have created functions to replace ' with ~ for
inserts/updates and replace ~ with ' when printing out the recordset.

Adrienne Boswell
Please respond to the group so others can share

Re: Quick PHP and/or MySQL question

@sbcglobal.net says...
Quoted text here. Click to load it

How about addslashes() and stripslashes() for PHP?  With PHP, the server
admin. can enable MAGIC_QUOTES which takes care of this for you.  It's
worth coding for the eventuality that the magic quotes setting will be
reversed by checking whether they're on or not.  The PHP docs has info.
on this.


Kill the Crazy Frog
   http://www.petitiononline.com/crzyfrg /

Site Timeline