Re: Special Character on INSERT statement
| From: | Jorge Giménez Mayorgas | Date: | Sun, 02 Sep 2001 18:32:20 +0000 |
| Subject: | Re: Special Character on INSERT statement | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-12100@lists.php.net to get a copy of this message | ||
Hi again
It is solved I used $value="'".urlencode($value)."'"
And urldecode for showing the data.
Thanks everybody for the help.
Later,
Jorge Giménez
----- Original Message -----
From: Jorge Giménez Mayorgas <jorgegmamg@hotmail.com>
To: <php-db@lists.php.net>
Sent: Wednesday, August 29, 2001 11:33 AM
Subject: Fw: [PHP-DB] Special character on an INSERT statement
> Hi again.
>
> I'm still trying but I can't do it.
>
> I have tried this :
>
> $values=$values.addslashes("'".$value).addslashes("'");
> The result of this would be something like this
> INSERT INTO Carrocerias VALUES (\'Ber\',\' Berlina\')
> The mysql_errno is 1064.
>
> I've tried mysql_escape_tring with the same result.
> Before INSERT statement I put this
> mysql_escape_string("\");
> but it didn't work.
>
> Can anyone where I could found an example ? I have looked on the online
> manual of php but they are SELECT examples, there are no INSERT examples.
> I ' m a newbie PHP programmer .
>
> Thanks again,
>
> Jorge Giménez
>
> ----- Original Message -----
> From: "Jorge Giménez Mayorgas" <jorgegmamg@hotmail.com>
> To: <php-db@lists.php.net>
> Sent: Tuesday, August 28, 2001 6:48 PM
> Subject: [PHP-DB] Special character on an INSERT statement
>
>
> Hi .
>
> I'm trying to do this on an INSERT statement.
>
> $sql= "INSERT .... (' TONS OF CD'S ')
> or any phrase with the character ' .
> Obviously it gives an error when execeting mysql_query.
>
> How can I do it ?
>
> Thanks,
>
> Jorge Giménez
>
>
>