From d83515b31ff5dcee19e9d31a04134619503d6f61 Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Sun, 26 Feb 2017 09:24:24 +0100 Subject: Added support for multiple queries in a single request. --- admin/database.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'admin') diff --git a/admin/database.php b/admin/database.php index 47ffd29..451e475 100644 --- a/admin/database.php +++ b/admin/database.php @@ -16,7 +16,10 @@ require_once '../core/application.php'; if(HTTP::issetPOST(['token' => Application::getSecurityToken()], 'command')) { try { $Statement = $Database->query(HTTP::POST('command')); - $result = print_r($Statement->fetchAll(), TRUE); + + do { + $result[] = print_r($Statement->fetchAll(), TRUE); + } while($Statement->nextRowset()); } catch(PDOException $Exception) { $messages[] = $Exception->getMessage(); } @@ -30,7 +33,7 @@ try { $DatabaseTemplate->set('FORM', [ 'INFO' => $messages ?? [], 'TOKEN' => Application::getSecurityToken(), - 'RESULT' => $result ?? NULL, + 'RESULT' => implode(NULL, $result ?? []), 'COMMAND' => HTTP::POST('command'), ]); -- cgit v1.2.3