RE: [PHP-DB] Names with apostrophe's
| From: | Hutchins, Richard | Date: | Wed, 29 Sep 2004 18:35:46 +0000 |
| Subject: | RE: [PHP-DB] Names with apostrophe's | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-36456@lists.php.net to get a copy of this message | ||
urlencode() or one of the related functions?
Not sure, but the docs looked reassuring.
> -----Original Message-----
> From: Craig Hoffman [mailto:choffman@eclimb.net]
> Sent: Wednesday, September 29, 2004 2:23 PM
> To: php-db@lists.php.net
> Subject: [PHP-DB] Names with apostrophe's
>
>
> Hello,
> I could use some help here. I have an entry in the MySQL,
> that use an
> apostrophe, for example lets call it "O'Reilly". I have added
> addslashes to my insert statement so MySQL accepts it with out
> complaining.
>
> The problem I am having is I use this information "O'Reilly"
> in a GET
> URL somewhere else in the site.
> For example here's my link:
> echo("<td><a
> href='user_book_results_detail.php?book=$row[book]>$row[book]</a></
> td>");
>
> When I mouse over and view the URL, PHP thinks the apostrophe
> (single
> quote) is the end and quits. I know I need to include a
> back slash or
> escape this character but I am not entirely sure how I do it?
> Suggestions?
>
> Sample URL:
> http://user_book_results_detail.php?book=O
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>