What are some best practices for designing a booking system in PHP that involves user statuses and event assignments?

When designing a booking system in PHP that involves user statuses and event assignments, it's important to create a database structure that can efficiently store and retrieve this information. One approach is to have tables for users, events, and bookings, with relationships defined between them. Additionally, using PHP classes and functions to handle the logic for user statuses and event assignments can help keep the code organized and maintainable.

```php
<?php

// Database connection
$servername = "localhost";
$username = "username";
$password = "password";
$dbname = "booking_system";

$conn = new mysqli($servername, $username, $password, $dbname);

// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}

// Define classes for User, Event, and Booking
class User {
    public $id;
    public $name;
    public $status;

    public function __construct($id, $name, $status) {
        $this->id = $id;
        $this->name = $name;
        $this->status = $status;
    }
}

class Event {
    public $id;
    public $name;

    public function __construct($id, $name) {
        $this->id = $id;
        $this->name = $name;
    }
}

class Booking {
    public $id;
    public $user_id;
    public $event_id;

    public function __construct($id, $user_id, $event_id) {
        $this->id = $id;
        $this->user_id = $user_id;
        $this->event_id = $event_id;
    }
}

// Function to assign user to an event
function assignUserToEvent($user_id, $event_id) {
    global $conn;

    $sql = "INSERT INTO bookings (user_id, event_id) VALUES ('$user_id', '$event_id')";

    if ($conn->query($sql) === TRUE) {
        echo "User assigned to event successfully";
    } else {
        echo "Error assigning user to event: " . $conn->error;
    }
}

// Function to update user status
function updateUserStatus($user_id, $status) {
    global $conn;

    $sql = "UPDATE users SET status = '$status' WHERE id = '$user_id'";

    if ($conn->query($sql) === TRUE)