Пример #1
0
 function sql($f3)
 {
     $query = $f3->get('POST.sqlQuery');
     Logger::Info($f3, "AdminPost.sql", "Executing: " . $query);
     $db = $f3->get('db');
     if ($query) {
         $query = trim($query);
         $f3->set('originalQuery', $query);
         try {
             $f3->set('sqlResult', DbWrapper::executeMultiSql($db, $query));
             $f3->set('error', '');
         } catch (Exception $e) {
             $f3->set('sqlResult', '');
             $f3->set('error', $e->getMessage());
             Logger::Error($f3, "AdminPost.sql", "SQL failed: " . $e->getMessage());
         }
     }
     echo Template::instance()->render('sqlprompt.htm');
 }