webdevdea Posted February 15, 2014 Share Posted February 15, 2014 echo '<p> <b>'.$row['topictitle'].'</b> '.$row['topicdescription'].'</p>' ; Im trying to make the 'topicdescription' a clickable link. I am trying to make my personal pdf library easier to access for my friends, so when they query the database I want it so they can just click on the link to download the material. Please and thank you . I have tried a few different things but nothing works so far. I thought I would just bring it to the experts. Link to comment https://forums.phpfreaks.com/topic/286212-create-link-from-database-query/ Share on other sites More sharing options...
jazzman1 Posted February 15, 2014 Share Posted February 15, 2014 What don't you understand, how to echo an anchor tag using php and php proper syntax or something else? Link to comment https://forums.phpfreaks.com/topic/286212-create-link-from-database-query/#findComment-1469004 Share on other sites More sharing options...
webdevdea Posted February 15, 2014 Author Share Posted February 15, 2014 Yes I am not understanding how to echo an anchor tag using php when I run my query, I want the results in an anchor tag and cant seem to get it to work.. Link to comment https://forums.phpfreaks.com/topic/286212-create-link-from-database-query/#findComment-1469013 Share on other sites More sharing options...
webdevdea Posted February 15, 2014 Author Share Posted February 15, 2014 echo '<p> <b>'.$row['topictitle'].'</b> '."<a href='". $row['topicdescription'] ."' >".'</p>'; I tried this, and it does not work... any ideas? Link to comment https://forums.phpfreaks.com/topic/286212-create-link-from-database-query/#findComment-1469015 Share on other sites More sharing options...
Ch0cu3r Posted February 15, 2014 Share Posted February 15, 2014 Where should the link go to? The correct syntax would be to wrap an achor tag around $row['topicdescription] echo '<p> <b>'.$row['topictitle'].'</b> <a href="link/location.php">'.$row['topicdescription']}.'</a></p>'; Change link/location.php to what you are linking to. Link to comment https://forums.phpfreaks.com/topic/286212-create-link-from-database-query/#findComment-1469024 Share on other sites More sharing options...
jazzman1 Posted February 15, 2014 Share Posted February 15, 2014 I tried this, and it does not work... any ideas? No, unless you show us the html output Link to comment https://forums.phpfreaks.com/topic/286212-create-link-from-database-query/#findComment-1469027 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.