forked from leftypol/leftypol
database.php: PDO always throw even on PHP < 8.0
This commit is contained in:
parent
b9081be4ac
commit
6c3f24e2a1
1 changed files with 1 additions and 0 deletions
|
@ -72,6 +72,7 @@ function sql_open() {
|
||||||
try {
|
try {
|
||||||
$options = [
|
$options = [
|
||||||
PDO::ATTR_TIMEOUT => $config['db']['timeout'],
|
PDO::ATTR_TIMEOUT => $config['db']['timeout'],
|
||||||
|
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, // Set a consistent error mode between PHP versions.
|
||||||
];
|
];
|
||||||
|
|
||||||
if ($config['db']['type'] == "mysql")
|
if ($config['db']['type'] == "mysql")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue