I am trying to create a link by calling the artist name from the database. When a name with an apostrophe is called php will stop at the apostrophe. Example: "Don't run" will return "don". I tried to use addslashes() but then I get "don/". Is there a way I can get php to call the name from the database with the apostrophe included? I would appreciate any help. Thanks.
Here is what I have:
$cleaner = addslashes($artist_name); //display the row echo "<FONT size=2><a href='/testartistpage.php?id=$cleaner'>$artist_name</a>";
Try using htmlentities(). Example:
echo "<FONT size=2><a href='/testartistpage.php?id=$cleaner'>", htmlentities($artist_name, ENT_QUOTES), "</a>";
hth.
Thank you so much. That did the trick.