check to see if the search was successful or not
This commit is contained in:
@@ -24,7 +24,11 @@ $query = "Select * from contacts where fname = '".$_POST["fname"]."' and lname =
|
||||
|
||||
|
||||
foreach($db_connection->query($query) as $row){
|
||||
if(empty($row){
|
||||
print("There is no user with that first and last name");
|
||||
else{
|
||||
print "First Name:".$row['fname']." Last Name:".$row['lname']." Username:".$row['username']."\n";
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -21,8 +21,12 @@ echo "<br>";
|
||||
$query = "Select * from contacts where username = '".$_POST["username"]."'";
|
||||
|
||||
foreach($db_connection->query($query) as $row){
|
||||
print(empty($row)."\n");
|
||||
print $row['username']." First Name:".$row['fname']." Last Name:".$row['lname']."\n";
|
||||
if(empty($row){
|
||||
print("There is no user with that name");
|
||||
}
|
||||
else{
|
||||
print $row['username']." First Name:".$row['fname']." Last Name:".$row['lname']."\n";
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user