I have the code:
try {
$db = new PDO("sqlite:filename.db");
$q = $db->prepare("SELECT p1 FROM T1;");
$q->execute(); // Fatal error: Uncaught Error: Call to a member function execute() on bool
} catch (PDOException $e) {
// Process any database errors in one place
}
The file “filename.db” does not exist at the moment.
I would like to process all DB errors in one place, but for some reason the message “Fatal error: Uncaught Error: Call to a member function execute() on bool” is not suppressed, but displayed on the page.
Tell me, please, why? Can I solve my problem: “process any database errors in one place”?