swampone Posted March 27, 2010 Share Posted March 27, 2010 I can print any info from my database to the screen but the links i have stored in the rows will not print. Im sure it has something to do with the special characters that make up a link. I think escaping the characters will help, but i have tried different ways to do it and cant get any to work. heres my test code <?php include 'config/db_connect.php'; $search ="play"; $query ="SELECT meta, link FROM videos WHERE meta LIKE '%$search%'"; $result = mysql_query($query); $row = mysql_fetch_row($result); $meta = $row[0]; $link = $row[1]; echo $meta; echo $link; ?> Link to comment https://forums.phpfreaks.com/topic/196732-echo-links-stored-in-the-database/ Share on other sites More sharing options...
trq Posted March 27, 2010 Share Posted March 27, 2010 You shouldn't have any trouble displaying links. What does your source (html) end up looking like with the above example? Link to comment https://forums.phpfreaks.com/topic/196732-echo-links-stored-in-the-database/#findComment-1032816 Share on other sites More sharing options...
swampone Posted March 27, 2010 Author Share Posted March 27, 2010 it will show only what is stored in $meta Link to comment https://forums.phpfreaks.com/topic/196732-echo-links-stored-in-the-database/#findComment-1032819 Share on other sites More sharing options...
trq Posted March 27, 2010 Share Posted March 27, 2010 Paste your outputted html source here. Link to comment https://forums.phpfreaks.com/topic/196732-echo-links-stored-in-the-database/#findComment-1032820 Share on other sites More sharing options...
swampone Posted March 27, 2010 Author Share Posted March 27, 2010 Ok, i viewed the source in chrome and then i viewed it in firefox. It shows to link in the source firefox file, but not in the chrome. Also, although i can see it in the source, it not showing on the page. here is the source from firefox. Roleplay With Eve Angel00:17:21<a href="http://www.pornhub.com/view_video.php?viewkey=2134714177" class="title" titl Link to comment https://forums.phpfreaks.com/topic/196732-echo-links-stored-in-the-database/#findComment-1032826 Share on other sites More sharing options...
trq Posted March 27, 2010 Share Posted March 27, 2010 Obviously its getting broken at the title attribute. If you run the same query from mysql's command line interface do you get complete links? Link to comment https://forums.phpfreaks.com/topic/196732-echo-links-stored-in-the-database/#findComment-1032834 Share on other sites More sharing options...
swampone Posted March 28, 2010 Author Share Posted March 28, 2010 It does shows the links just like the source does. i think once i make ajustments to my regular expessions I should be able to clean up the incomplete. I just noticed another problem though. I can now see my info in firefox, but not google chrome. Link to comment https://forums.phpfreaks.com/topic/196732-echo-links-stored-in-the-database/#findComment-1032846 Share on other sites More sharing options...
trq Posted March 28, 2010 Share Posted March 28, 2010 It does shows the links just like the source does. Obviously your data is incomplete then. Likely getting broken on the way into the database. Link to comment https://forums.phpfreaks.com/topic/196732-echo-links-stored-in-the-database/#findComment-1032877 Share on other sites More sharing options...
swampone Posted March 28, 2010 Author Share Posted March 28, 2010 i figured it out! The good news is the reason why links are broken is because, I did not set my character length long enough in mysql. The bad news is I had to delete over 17,000 records. Link to comment https://forums.phpfreaks.com/topic/196732-echo-links-stored-in-the-database/#findComment-1033096 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.