i have set up a search of my database and now i want wen i click a result it to take me to a page were i can have the user edit the information this is my search code:
<?php require('check_login.php'); echo "Logout"; echo " "; echo "Home"; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-… SearchSearch
' /><?php $k = $_GET['k']; $terms = explode(" ", $k); $query = "SELECT * FROM patients WHERE ";
foreach ($terms as $each){
$i++;
if ($i == 1)
$query .= "Keyword LIKE ‘%$each%’ ";
else
$query .= "OR Keyword LIKE ‘%$each%’ ";
}
// connect
mysql_connect(“localhost”, “root”, “password”);
mysql_select_db(“hospital_patients”)…
$query = mysql_query($query);
$numrows = mysql_num_rows($query);
if ($numrows > 0){
while ($row = mysql_fetch_assoc($query)){
$id = $row[‘id’];
$name = $row[‘First_Name’];
$lname = $row[‘Last_Name’];
echo "
$name, $lname
";
}
}
else
echo “No results found for “$k””;
// disconnect
mysql_close();
?>