I am new to PHP. I have a MySQL database with a column of URL's. I have a PHP script that randomizes the URL's and echoes the result to the browser. I just need a need a way to turn the randomized URL into a clickable link. I would imagine maybe I need to use javascript to do this but I am not sure. I have done a ton of research but cannot find a solution, but maybe I am not looking for the correct solution. If I need to post my script just let me know. Thanks.
Tekkno
1
Junior Poster
Recommended Answers
Jump to Post<?php $result = mysql_query("SELECT url, title FROM links_table ORDER BY RAND() LIMIT 1"); $row = mysql_fetch_row($result); $url = $row[0]; $title = $row[1]; echo "<a href=\"$url\">$title</a>"; ?>
All 4 Replies
Dani
4,084
The Queen of DaniWeb
Administrator
Featured Poster
Premium Member
Tekkno
1
Junior Poster
TommyBs
1
Junior Poster in Training
Tekkno
1
Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.