What are the potential pitfalls of trying to run SQLite with mysqli code instead of PDO?

Using mysqli code with SQLite can lead to compatibility issues and potential errors due to differences in syntax and functionality between MySQL and SQLite. To avoid these pitfalls, it is recommended to use PDO (PHP Data Objects) with SQLite, as it provides a consistent interface for accessing different database systems.

// Connect to SQLite using PDO
try {
    $pdo = new PDO('sqlite:database.db');
    $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (PDOException $e) {
    echo 'Connection failed: ' . $e->getMessage();
}