RE: [PHP] Apostrophe's

From: Date: Wed, 09 Aug 2000 14:59:07 +0000
Subject: RE: [PHP] Apostrophe's
Groups: php.general 
Request: Send a blank email to php-general+get-10933@lists.php.net to get a copy of this message
> Using PHP and MYSQL in various database projects, I have run into the > problem of having an apostrophe -- ' -- in a value.. For example, if > someone submits "Bob's Wharehouse" as a value for the column > SUPPLIER, I have to go in and either remove the apostrophe or "double" it > ('') so it is interpreted appropriately. > I have been doing this with the following code: > $NAME = strtr($NAME, "'", "''"); addslashes() is your friend. Chris

« previous php.general (#10933) next »