What are some potential pitfalls of using both a custom class for database operations and the outdated mysql functions in PHP?

Using both a custom class for database operations and the outdated mysql functions in PHP can lead to confusion, inconsistency, and potential security vulnerabilities. It is recommended to stick to one method for interacting with the database to ensure code maintainability and security.

// Example of using only a custom class for database operations

class Database {
    private $connection;

    public function __construct($host, $username, $password, $database) {
        $this->connection = new mysqli($host, $username, $password, $database);
    }

    public function query($sql) {
        return $this->connection->query($sql);
    }

    // Add more methods for database operations as needed
}

// Example of using the custom database class
$db = new Database('localhost', 'username', 'password', 'database');
$result = $db->query("SELECT * FROM users");