I'm trying to echo certain details of a specific user defined in the url (like this:
search_result.php?lastname=Doe&date_of_birth=1964-04-12)
$lname = mysqli_real_escape_string($_GET['lastname']);
$dob = mysqli_real_escape_string($_GET['date_of_birth']);
$result= mysql_query("SELECT * FROM qfever WHERE lastname = '$lname' AND date_of_birth = '$dob'");
while($row = mysql_fetch_array($result)) {
$firstname = $row['firstname'];
$lastname = $row['lastname'];
$date_of_birth = $row['date_of_birth'];
$employee_number = $row['employee_number'];
}
echo $firstname;
echo $lastname;
echo $date_of_birth;
echo $employee_number;
I can echo what it picks up from the url but it does not echo the user's details from the database.
Could the problem be the format of the dates?
My
date_of_birth column in the database is currently set to
TEXT but the HTML input type is set to
DATE