Re: Re: SQL woes (newbie question) - PHP 4.3.6 & ADOdb

From: Date: Wed, 28 Apr 2004 15:05:28 +0000
Subject: Re: Re: SQL woes (newbie question) - PHP 4.3.6 & ADOdb
References: 1 2 3 4 5 6  Groups: php.general 
Request: Send a blank email to php-general+get-184885@lists.php.net to get a copy of this message
Tom Rogers wrote:
Hi, Thursday, April 29, 2004, 12:16:14 AM, you wrote:
Thanks! Gabe
Thanks for the link, looks like that will do the trick. But I was also wondering then, when I use a SELECT statement to retrieve the same data and display it, is there a function that will remove all the escape characters? I didn't see anything in the mysql function list.
This should do the trick: http://de3.php.net/manual/en/function.stripslashes.php Regards, Torsten
G> Hi Torsten, G> I tried using that function this morning like you suggested, but when I G> ran it I suddenly realized that I'm running an Access db not a mysql db. G> The function asks for a resource connection to a mysql db. Is there a G> similar function that you know of that will do the same thing for an G> access query? Many thanks! G> Gabe The escape is probably to use 2 single quotes so you can do this: $text = str_replace("'","''",$text) before the insert. There is no need to un-escape as the info in the db will just be the single quote.
This is why newsgroups are so awesome... you're able to learn so many ways to skin the cat. Thanks for your suggestion. What I ended up finding was a Quote() function in the ADOdb library that effectively takes care of all the quotes in the string. Thanks again!

« previous php.general (#184885) next »