exec('CREATE TABLE users(id INT NOT NULL PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL, email TEXT DEFAULT NULL, password TEXT NOT NULL'); $db->exec('INSERT INTO users (name, email, password) VALUES ("john.doe", "john.doe@example.com", "1234"));'); $db->exec('INSERT INTO users (name, email, password) VALUES ("jane.doe", "jane.doe@example.com", "asdf"));'); // Create a SQLite3Stmt, bind some values and execute the SQL command safely $stmt = $db->prepare('SELECT * FROM users WHERE id=:id AND name=:name'); $stmt->bindValue(':id', 1, SQLITE3_INTEGER); $stmt->bindValue(':name', "john.doe", SQLITE3_TEXT); // Execute statement and get first row as an associative Array $res = $stmt->execute(); var_dump($res->fetchArray());