Assign Guest To Lodging

Function Number: 6

Function Name: Assign Guest To Lodging

Link to Function Implementation

Function Type: Insertion

Description: This function accepts the following inputs: Booking ID, Guest ID, Site Name, and Lodging Number. These four parameters form the full record inserted into the table 'assign_lodging', which tracks lodging assignments.

Primary Users: Resort staff responsible for creating or managing reservations

Tables Affected: assign_lodging

Sample Input: Booking ID = 1, Guest ID = 1, Site Name = 'Clark', Lodging Number = 101

Sample Output: [booking_id: 1, guest_id: 1, site_name: Clark, lodging_number: 101]

Notes: This function consists of one insert query. All parameters passed to the web form (Booking ID, Guest ID, Site Name, and Lodging Number) are mandatory and if they are not submitted a message is displayed informing the user that these fields are required (using mysqli_num_rows()). Error checking is provided such that if an error occurs, the error message will be echoed out to the user in the format "ERROR: $error_specific_message." For example, attempting to insert a duplicate record will result in "ERROR Updating Table Duplicate entry '1-1-Clark -101' for key 'PRIMARY'" being echoed.

Main Menu