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. Quote 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? Quote 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 (edited) 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.. Edited February 15, 2014 by webdevdea Quote 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? Quote 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 (edited) 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. Edited February 15, 2014 by Ch0cu3r Quote Link to comment https://forums.phpfreaks.com/topic/286212-create-link-from-database-query/#findComment-1469024 Share on other sites More sharing options...
Solution jazzman1 Posted February 15, 2014 Solution Share Posted February 15, 2014 I tried this, and it does not work... any ideas? No, unless you show us the html output Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.