Re: Single quotes in INSERT statements?
| From: | Martin Alterisio | Date: | Tue, 25 Apr 2006 19:10:03 +0000 |
| Subject: | Re: Single quotes in INSERT statements? | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-41744@lists.php.net to get a copy of this message | ||
1) Check that the string is not being truncated because of the column length
2) If you're seeing this data being truncated in the html output of your
site, check if it isn't being caused by outputing the data without properly
encoding special html characters.
3) ..... dunno
2006/4/25, Skip Evans <skip@bigskypenguin.com>:
>
> Hello all,
>
> I'm brand spanking new to the list and have a
> quick question.
>
> I was under the impression that addslashes() would
> handle single quote marks in INSERT statements,
> but when I execute the following:
>
> $sql="UPDATE images SET orderno=$orderno,
> url='".addslashes($url)."',
> banner=$banner,caption='".addslashes($caption)."'
> WHERE imageID=$imageID";
>
> ...and $caption contains something like:
>
> "Don't look"
>
> ...the data is chopped off at the single quote mark.
>
> How, if not addslashes(), does one handle this?
>
> Thanks!
> --
> Skip Evans
> Big Sky Penguin, LLC
> 61 W Broadway
> Butte, Montana 59701
> 406-782-2240
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>