[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [cobalt-users] PHP and single quotes



Prefix the text you're sending with addslashes(), it'll put them in there
for you automatically

--

Regards,

Patrick Smith



-----Original Message-----
From: cobalt-users-admin@xxxxxxxxxxxxxxx
[mailto:cobalt-users-admin@xxxxxxxxxxxxxxx]On Behalf Of Dylan Smith
Sent: Thursday, May 31, 2001 9:30 AM
To: cobalt-users@xxxxxxxxxxxxxxx
Subject: Re: [cobalt-users] PHP and single quotes


> I am using a local linux server, and a win2k server in the office, both
with
> MySQL 3.23.37 and PHP 4.0.4, and if I add a block of text to the database
> with a single quote, ie "paul's nice email message." all works fine.

You must escape it. Send this instead:

"paul\'s nice email message."

The \ before the ' tells MySQL to take ' literally.


_______________________________________________
cobalt-users mailing list
cobalt-users@xxxxxxxxxxxxxxx
To Subscribe or Unsubscribe, please go to:
http://list.cobalt.com/mailman/listinfo/cobalt-users