aksdesigns Posted December 13, 2009 Share Posted December 13, 2009 Hey guys, Small problem... On my site: http://www.megalyrics.net Apostrophes stop any more text after it showing in link titles. For example, on the right hand side half way down the page the album name: You're The Designers, We're The Deciders for the band Not Advised. if you hover, or check the source - it stops at You. The code is: echo "</td><td class='listingtitle'>Artist: <b></td><td><a href='http://megalyrics.net/search.html?c=".$row[artist]."' alt='View ".$row[artist]." Lyrics' title='View ".$row[artist]." Lyrics'>".$row[artist]."</a></b></td></tr><tr><td class='listingtitle'>Album:</td><td><a href='http://megalyrics.net/search.html?c=".$row[album]."' title='View ".$row[album]." Lyrics' title='View ".$row[album]." Lyrics'>".$row[album]."</a></td></tr><tr><td class='listingtitle'>Views:</td><td><font color='#444444'>".$row[views]."</font></td></tr>"; Any ideas why it is stopping at the apostrophe in the generated code and how it can be fixed? Quote Link to comment https://forums.phpfreaks.com/topic/184993-apostrophe-stopping-database-text-showing/ Share on other sites More sharing options...
teamatomic Posted December 13, 2009 Share Posted December 13, 2009 You should escape those before you insert them $escaped_string = "You\'re The Designers, We\'re The Deciders for the band Not Advised"; HTH Teamatomic Quote Link to comment https://forums.phpfreaks.com/topic/184993-apostrophe-stopping-database-text-showing/#findComment-976562 Share on other sites More sharing options...
premiso Posted December 13, 2009 Share Posted December 13, 2009 You should probably use the proper escaping function for your database, for instance in MySQL it is mysql_real_escape_string. Quote Link to comment https://forums.phpfreaks.com/topic/184993-apostrophe-stopping-database-text-showing/#findComment-976568 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.