For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > September 2004 > Names with apostrophe's









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Names with apostrophe's
Craig Hoffman

2004-09-29, 8:03 pm

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
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com