Search For A Reservation

Function Number: 5

Function Name: Search For A Reservation

Link to Function Implementation

Function Type: Query

Description: This function accepts any of the following as inputs: Guest First Name, Guest Last Name, Guest ID, Booking ID, Guest Phone, or Guest Email . This function returns two tables: A list of all reservation entries linked to Guest ID or Booking ID if they were provided, and a table displaying all records containing any of the guest information (name, email, phone) that were provided.

Primary Users: Resort staff responsible for creating or managing reservations

Tables Affected: reservation and guests

Sample Input: Guest First Name = 'Gordon', Booking ID = 1

Sample Output: [guest_id: 1, booking_id: 1, occurred: 2021-02-14 09:34:22, status: scheduled, bank: Chase, acct: 8569652125]

Notes: This function consists of two seperate queries. One query simply selects any records matching a provided Booking or Reservation ID. The second implements a nested query. The inner query will return a set of Guest IDs containing provided information such as name, phone, or email. The outer query then uses this set to retrieve any records in the table 'reservation' that match a Guest ID contained in the set. This function also implements error checking by using the mysqli_num_rows() to ensure that search parameters return at least one result.

Main Menu