diff options
author | Thomas Lange <code@nerdmind.de> | 2017-02-26 09:24:24 +0100 |
---|---|---|
committer | Thomas Lange <code@nerdmind.de> | 2017-02-26 09:24:24 +0100 |
commit | d83515b31ff5dcee19e9d31a04134619503d6f61 (patch) | |
tree | 60d31ab57ff89c90266e7b8b8036cfc931e73e53 | |
parent | 63c97d4721c3869320d4c5c05ce8c8d66bec1fbf (diff) | |
download | blog-d83515b31ff5dcee19e9d31a04134619503d6f61.tar.gz blog-d83515b31ff5dcee19e9d31a04134619503d6f61.tar.xz blog-d83515b31ff5dcee19e9d31a04134619503d6f61.zip |
Added support for multiple queries in a single request.
-rw-r--r-- | admin/database.php | 7 |
1 files changed, 5 insertions, 2 deletions
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'), ]); |