Hi, ive been using the following pieces of code to search my database and then output the search results underneath, however i cant seem to make the result it outputs become a link? how would i go about doing this, would i need to change it in the database? At the moment it searches the database for the title column and display anything with a matching title, but i want it to then make what it outputs a link, would this mean me having to alter something in the database to make a connection between titles and links to another page?
[php]
<?php $db_hostname = 'localhost'; $db_username = 'root'; $db_password = 'password'; $db_database = 'days'; // Database Connection String $con = mysql_connect($db_hostname,$db_username,$db_password); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db($db_database, $con); ?> Search:<?php if (!empty($_REQUEST['term'])) {
$term = mysql_real_escape_string($_REQUEST[‘term’]);
$sql = “SELECT * FROM adrenaline WHERE title LIKE '%”.$term."%’";
$r_query = mysql_query($sql);
while ($row = mysql_fetch_array($r_query)){
echo ’
'.$row[‘title’];
}
}
?>[/php]
many thanks.