RCS Posted April 19, 2008 Share Posted April 19, 2008 I have a form where I input a link and a description for that link to a mysql database, the problem that I'm having is when I submit the link http://somesite.com the out come is just that and I need it to be an actual hyperlink, can someone tell me how to do this. Here is my code <?php include("dbinfo.inc"); $con = mysql_connect($db_host, $db_user, $db_pass) or die ("Could not connect to database."); mysql_select_db("$db_name", $con); $result = mysql_query ("SELECT * FROM service ORDER BY id"); echo "<table border='1'> <tr> <th width='200'>Service Links</th> <th width='200'>Description</th> </tr>"; while($row = mysql_fetch_array ($result)) { echo "<tr>"; echo "<td>" . $row['links'] . "</td>"; [color=orange]//THIS SHOULD BE HYPERLINK[/color] echo "<td>" . $row['description'] . "</td>"; echo "</tr>"; } echo "</table>"; ?> Thanks in advance. Quote Link to comment Share on other sites More sharing options...
unidox Posted April 19, 2008 Share Posted April 19, 2008 Try using <a>Link</a> Quote Link to comment Share on other sites More sharing options...
RCS Posted April 19, 2008 Author Share Posted April 19, 2008 Not sure what you mean SEE I TYPE IT INTO THE FORM LIKE http://somesite.com AND CALL IT LIKE echo "<td>" . $row['links'] . "</td>"; BUT IT SHOWS UP LIKE http://somesite.com BUT NOT HYPERLINK so how would I call it from the database as a hyperlink??? Quote Link to comment Share on other sites More sharing options...
RCS Posted April 19, 2008 Author Share Posted April 19, 2008 Not sure I understand what you mean?? Quote Link to comment Share on other sites More sharing options...
Rohan Shenoy Posted April 19, 2008 Share Posted April 19, 2008 while($row = mysql_fetch_array ($result)) { echo "<tr>"; echo "<td><a href=\"".$row[links]."\">".$row[links]."</a></td>"; [color=orange]//THIS SHOULD BE HYPERLINK[/color] echo "<td>" . $row['description'] . "</td>"; echo "</tr>"; } echo "</table>"; Quote Link to comment Share on other sites More sharing options...
RCS Posted April 19, 2008 Author Share Posted April 19, 2008 Thank you very much, I have one more question for you. what if I wanted to have it so echo "<td><img src =\"upload/" . $row['name']."\"></td>"; has a hyperlink added to the image say http://somesite.com Quote Link to comment 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.