Re: Convert a string so it is valid for a sql query
| From: | nayco | Date: | Mon, 10 Sep 2001 16:44:32 +0000 |
| Subject: | Re: Convert a string so it is valid for a sql query | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-66778@lists.php.net to get a copy of this message | ||
$corrected_string=addslashes($string_to_correct) ????
I think this function does it...
or maybe :
$corrected_string=ereg_replace("/'/","\'",$string_to_correct)
---->(i'm
not sure of the syntax).
(°- Nayco,
//\ Nayco@netcourrier.com
v_/_ http://nayco.free.fr
----- Original Message -----
From: Brandon Orther <orther@webintellects.com>
To: PHP User Group <php-general@lists.php.net>
Sent: Monday, September 10, 2001 6:09 PM
Subject: [PHP] Convert a string so it is valid for a sql query
> Hello,
>
> Is there a function to convert a string so it is a valid string of text
> for a SQL query? AN example would be a string of text that has ' in it
> would be converted to \'
>
> Thank you,
>
> --------------------------------------------
> Brandon Orther
> WebIntellects Design/Development Manager
> brandon@webintellects.com
> 800-994-6364
> www.webintellects.com
> --------------------------------------------
>
>