Answer the question
In order to leave comments, you need to log in
PHP PDO SQLITE: how to fix "could not find driver" error?
There is a server running apache+php on it.
phpinfo says that:
PDO
PDO support enabled
PDO drivers sqlite2
try {
$this->link = new PDO('sqlite:./db/mydb.sqlite2');
$this->link->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch(PDOException $e) {
exit($e -> getMessage());
}
Answer the question
In order to leave comments, you need to log in
Actually, by default sqlite3.
try {
$this->link = new PDO('sqlite2:./db/mydb.sqlite2');
$this->link->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch(PDOException $e) {
exit($e -> getMessage());
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question