aviel131 Posted January 4, 2010 Share Posted January 4, 2010 i got row name "links" and its have links from textarea now i want to display the links like this: lets say i have link name members.facebook.com/blabla.php and members.facebook.com/blabl121a.php i want to display title: members.facebook.com and the link here like <a href="members.facebook.com/blabla.php"> how can i do this? Link to comment https://forums.phpfreaks.com/topic/187079-display-row-result/ Share on other sites More sharing options...
gizmola Posted January 4, 2010 Share Posted January 4, 2010 You really need to clarify your question. Is this a database issue or a problem with your understanding of string manipulation, or a problem with your understanding of PHP, or ???? Let's see what code you have, and a describe on any pertinent database tables. Link to comment https://forums.phpfreaks.com/topic/187079-display-row-result/#findComment-987926 Share on other sites More sharing options...
aviel131 Posted January 4, 2010 Author Share Posted January 4, 2010 $q=mysql_query("SELECT * FROM downloads WHERE id=5"); while ($row=mysql_fetch_array($q)) { echo $row['links']; } its show me the all links i want its make order in links and put lets say site "facebook" under title "facebook" and site "blabla.com" under title "blabla.com" Link to comment https://forums.phpfreaks.com/topic/187079-display-row-result/#findComment-987929 Share on other sites More sharing options...
gizmola Posted January 4, 2010 Share Posted January 4, 2010 First off, change your query to: SELECT * FROM downloads WHERE id=5 ORDER BY links This will sort them in ascending order. Then it looks like you want to parse out the domain from the $row['links']; Something liike this ought to put you on the right track: $domain = ''; while ($row=mysql_fetch_array($q)) { $t = parse_url($row['links']); if ($domain !== $t['host']) { $domain = $t['host']; echo "$domain\n"; } echo '' . $row['links'] . "\n"; } Link to comment https://forums.phpfreaks.com/topic/187079-display-row-result/#findComment-987938 Share on other sites More sharing options...
aviel131 Posted January 4, 2010 Author Share Posted January 4, 2010 its return: Notice: Undefined index: host in C:\wamp\www\4down\download.php on line 194 Notice: Undefined index: host in C:\wamp\www\4down\download.php on line 195 Link to comment https://forums.phpfreaks.com/topic/187079-display-row-result/#findComment-988214 Share on other sites More sharing options...
fenway Posted January 6, 2010 Share Posted January 6, 2010 Since we don't see line numbers, and that's purely a php error, it's hard to say. Link to comment https://forums.phpfreaks.com/topic/187079-display-row-result/#findComment-989556 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.