...

View Full Version : how do you do this?



googleit
08-29-2006, 08:53 PM
how do you get plain text from a mysql db an turn them into hyperlinks? here is the code i have so far

<?php
mysql_connect("host","username","pass");
mysql_select_db("dbname");
$query = "SELECT data,site FROM site where id=$id";
$result = MYSQL_QUERY($query);
$data = MYSQL_RESULT($result,0,"data");
print $data;
?>
any help would be great :)

GJay
08-29-2006, 08:57 PM
you echo the html, and then the browser interprets it:


$variable='http://www.example.com';
echo '<a href="'.$variable.'">Link Text</a>';

mysql plays no relevant part.

googleit
08-29-2006, 08:59 PM
ok thanks ill try your code

Lee Stevens
08-29-2006, 11:14 PM
But if you wanted to to do a random site link eveytime just use a DB to store it all then just select the description and link.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum