Re: Special characters --> single quote
| From: | ludovic | Date: | Tue, 22 Aug 2000 12:57:38 +0000 |
| Subject: | Re: Special characters --> single quote | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-12927@lists.php.net to get a copy of this message | ||
James,
If I make
"UPDATE toto SET OBSERVATION = '".addslashes."' WHERE id=$number";
I will see in the field OBSERVATION the string addslashes, isn't it ?
I don't think that the uppercase or lowercase is important for the name of the
table ...
Anymore, I have tried in lower case but always the same problem...
UPDATE toto SET observation = '$OBSERVATION' WHERE id=$number
The only solution that I have found for the moment is to replace the single
quote by the double quote
but I am not very satisfied by this one.
$OBSERVATION=ereg_replace("[']","\"",$OBSERVATION);
I have got the same problem for MicrosoftSQLServer.
James Moore a écrit :
> >
> > This is the query
> >
> > $query =
> > "update toto set
> > OBSERVATION='$OBSERVATION' where id =$number";
>
> OK.
>
> "UPDATE toto SET OBSERVATION = '".addslashes."' WHERE
> id=$number";
> ^^^^^^^^^^^- Personal opinion but tables should be in
> lowercase when created, then they are easier to see in SQL statements, (Caps
> all Keywords, lowercase all table/col names).
>