Triniton722 Posted May 12, 2014 Share Posted May 12, 2014 Hello. I have a bit of a problem. When I fetch the link field from the database.i don't see an actual link on the page. One more thing, what type of field should I use to store the link in the database? Probably there is where I went wrong. All help is Quote Link to comment https://forums.phpfreaks.com/topic/288444-how-do-i-retrieve-a-link-from-a-mysql-database-so-that-it-behaves-like-a-link-in-the-php-page/ Share on other sites More sharing options...
Barand Posted May 12, 2014 Share Posted May 12, 2014 What have you got so far? Let's start from there. Quote Link to comment https://forums.phpfreaks.com/topic/288444-how-do-i-retrieve-a-link-from-a-mysql-database-so-that-it-behaves-like-a-link-in-the-php-page/#findComment-1479251 Share on other sites More sharing options...
Triniton722 Posted May 12, 2014 Author Share Posted May 12, 2014 <?php $con=mysqli_connect("","root","","tibiblog"); // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } $result = mysqli_query($con,"SELECT * FROM articles"); while($row = mysqli_fetch_array($result)) { echo $row['title'] . " " . $row['summary'] . " " .$row['link']; echo "<br>"; } mysqli_close($con); ?> Quote Link to comment https://forums.phpfreaks.com/topic/288444-how-do-i-retrieve-a-link-from-a-mysql-database-so-that-it-behaves-like-a-link-in-the-php-page/#findComment-1479252 Share on other sites More sharing options...
Barand Posted May 12, 2014 Share Posted May 12, 2014 Basic HTML - Links use <a>....</a> tags. <a href='{$row['link']}'>Click here</a> varchar(N) should be fine for storing a link, where N is the max size you need to store Quote Link to comment https://forums.phpfreaks.com/topic/288444-how-do-i-retrieve-a-link-from-a-mysql-database-so-that-it-behaves-like-a-link-in-the-php-page/#findComment-1479254 Share on other sites More sharing options...
Triniton722 Posted May 12, 2014 Author Share Posted May 12, 2014 Thanks! I appreciate a lot your help. Quote Link to comment https://forums.phpfreaks.com/topic/288444-how-do-i-retrieve-a-link-from-a-mysql-database-so-that-it-behaves-like-a-link-in-the-php-page/#findComment-1479257 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.