echo"Failed to connect to MySQL: ".mysqli_connect_error();
echo"Failed to connect to MySQL: ".mysqli_connect_error();
}
}
//$data = mysqli_query($con, "SELECT Passenger_Id FROM Passenger_Profile WHERE First_Name = '$First_Name' AND Last_Name = '$Last_Name' AND Flight_Number = '$Flight_Number'");
$data=mysqli_query($con,"SELECT Passenger_Id FROM Passenger_Profile WHERE First_Name = '$First_Name' AND Last_Name = '$Last_Name' AND Flight_Number = '$Flight_Number'");
$data=mysqli_query($con,"SELECT Profile_Id FROM Passenger_Profile WHERE First_Name = '$First_Name' AND Last_Name = '$Last_Name'");
//And display the results
//And display the results
while($row=mysqli_fetch_array($data))
while($row=mysqli_fetch_array($data)){
{
// echo "$row[0]". " ";
echo"$row[0]"." ";
// echo "<br>";
echo"<br>";
$Profile_Id=$row[0];
;
echo$Profile_Id;
}
}
//This counts the number or results. If there aren't any, it gives the user a "no match" message
$data2=mysqli_query($con,"SELECT Flight_Id FROM FlightData WHERE Flight_Number = '$Flight_Number'");
$anymatches=mysqli_num_rows($data);
while($row2=mysqli_fetch_array($data2)){
if($anymatches==0)
// echo "$row[0]". " ";
{
// echo "<br>";
echo"Sorry, but we can not find an entry to match your query<br><br>";
$Flight_Id=$row2[0];
}
echo$Flight_Id;
}
//And reminds the user what they searched for
// echo "<b>Searched For:</b> " . "$find";
//And display the results
// }
// while($row = mysqli_fetch_array( $data )) {
// echo "$row[0]". " ";
//break;
// echo "<br>";
//
//
// if (isset($_GET['Passenger_Id#
// }
// '])) {
//
//This counts the number or results. If there aren't any, it gives the user a "no match" message
// $Passenger_Id = $_GET['Passenger_Id'];
$anymatches=mysqli_num_rows($data);
// echo $Passenger_Id;
if($anymatches==0){
echo"Sorry, but we can not find an entry to match your query<br><br>";
// }
}
echo"Your input:::::::::<br>";
echo"".$First_Name."<br>";
//And reminds the user what they searched for
echo"".$Last_Name."<br>";
// echo "<b>Searched For:</b> " . "$find";
echo"".$Flight_Number."<br>";
// }
//sql to delete a record
//break;
$data=mysqli_query($con,"DELETE FROM Ticket_Info WHERE Passenger_fk = $row[0]");
//
if(mysqli_query($con,$data)){
// if (isset($_GET['Passenger_Id#
echo"Record deleted successfully";
// '])) {
}else{
//
echo"Error deleting record: ".mysqli_error($con);
// $Passenger_Id = $_GET['Passenger_Id'];
}
// echo $Passenger_Id;
// mysqli_query($con, "DELETE FROM Ticket_Info WHERE Passenger_fk = $row[0]");