Answer the question
In order to leave comments, you need to log in
Why does PDO execute() on SQLite return false?
I am using PDO with SQLite on PHP 7.2 (OpenServer), when executing the code:
$db = new PDO("sqlite:./resources/main.db");
$user = $db->prepare('SELECT * FROM users WHERE login = ?')->execute(array($_POST['login']))->fetch();
Fatal error: Uncaught Error: Call to a member function fetch() on boolean in login.php:14 Stack trace: #0 {main} thrown in login.php on line 14
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
- showed nothing.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question