RE: [PHP-WIN] RE: USING PHP to add ' to SQL
| From: | Flint Doungchak | Date: | Thu, 27 Jul 2000 22:56:02 +0000 |
| Subject: | RE: [PHP-WIN] RE: USING PHP to add ' to SQL | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-1351@lists.php.net to get a copy of this message | ||
I've been working on this problem for a while and figured out that in SQL Server 7.0, you
need to proceed a ' or a " with itself to escape it.
Adding slashes doesn't work. That's a little annoying. Does anyone know how to set SQL
Server to use / as the escape character?
So
UPDATE events set starttime = '20000820 12:40',event='Flint""s Dorkey
Stuff' where
eventid='1'
select * from events
returns Flint""s Dorkey Stuff
which is dumb since I now have to strip out the extra quote. Any ideas?
-Flint
> -----Original Message-----
> From: Foley, John [mailto:John.Foley@pollak.com]
> Sent: Thursday, July 27, 2000 12:29 PM
> To: 'Tom.com'; php-windows@lists.php.net
> Subject: [PHP-WIN] RE: USING PHP to add ' to SQL
>
>
>
>
> Look for the addslashes() function . . .
>
>
> > -----Original Message-----
> > From: Tom.com [SMTP:tom.com@asia.com]
> > Sent: Wednesday, July 26, 2000 11:49 AM
> > To: php-windows@lists.php.net
> > Subject: USING PHP to add ' to SQL
> >
> > Anybody know how to handle those characters such as " ' ",
> " | " etc when
> > insert into a SQL database?
> >
> >
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net
> For additional commands, e-mail: php-windows-help@lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin@lists.php.net
>