Skip to content
Snippets Groups Projects
Commit b66abdb8 authored by Till Brehm's avatar Till Brehm
Browse files

Merge branch 'stable-3.1' into 'stable-3.1'

check if the database exists in db_update



See merge request !520
parents e2e9036c d0b93dd7
No related branches found
No related tags found
1 merge request!520check if the database exists in db_update
......@@ -278,6 +278,12 @@ class mysql_clientdb_plugin {
return;
}
// check if the database exists
if($data['new']['database_name'] == $data['old']['database_name']) {
$result = $link->query("SHOW DATABASES LIKE '".$link->escape_string($data['new']['database_name'])."'");
if($result->num_rows === 0) $this->db_insert($event_name, $data);
}
// get the users for this database
$db_user = $app->db->queryOneRecord("SELECT `database_user`, `database_password` FROM `web_database_user` WHERE `database_user_id` = ?", $data['new']['database_user_id']);
$old_db_user = $app->db->queryOneRecord("SELECT `database_user`, `database_password` FROM `web_database_user` WHERE `database_user_id` = ?", $data['old']['database_user_id']);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment