Remove the unset($database) statements (#7084)

* Remove the unset($database) statements
The database object is a global variable that contains a database object reference and should not be unset.

* Update event_guard.php

* Update event_guard.php

* Update event_guard.php

---------

Co-authored-by: Tim Fry <tim@fusionpbx.com>
Co-authored-by: FusionPBX <markjcrane@gmail.com>
This commit is contained in:
frytimo
2024-08-06 16:19:45 -03:00
committed by GitHub
parent c960575796
commit 7630056bb8
6 changed files with 34 additions and 44 deletions

View File

@@ -38,6 +38,9 @@
exit;
}
//connect to database
$database = database::new();
//add multi-lingual support
$language = new text;
$text = $language->get();
@@ -78,7 +81,6 @@
//prepare to page the results
$sql = "select count(*) from v_databases ";
$database = new database;
$num_rows = $database->select($sql, null, 'column');
//prepare to page the results
@@ -92,7 +94,6 @@
$sql = str_replace('count(*)', '*', $sql);
$sql .= order_by($order_by, $order);
$sql .= limit_offset($rows_per_page, $offset);
$database = new database;
$databases = $database->select($sql, null, 'all');
unset($sql);