1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/emailpoubelle_ynh.git synced 2024-09-03 18:26:29 +02:00

Gestion du LastID pour sqlite & le reste du monde

This commit is contained in:
Krakinou 2018-12-01 10:44:01 +01:00 committed by GitHub
parent e7b92f49a3
commit 75542a35bc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -79,7 +79,13 @@ function AjouterAlias($status, $alias,$email, $life, $comment) {
die(); die();
} }
UpdateVirtualDB(); UpdateVirtualDB();
return $dbco->lastInsertId(); if (preg_match('/^sqlite/', DB)) {
return $dbco->lastInsertId();
} else {
$stmt = $dbco->query("SELECT LAST_INSERT_ID()");
return $stmt->fetchColumn();
}
} }
// delete email // delete email