Exemplo n.º 1
0
<?php

error_reporting(E_ALL);
require "../conf.php";
if (!isset($_POST['query'])) {
    $_POST['query'] = null;
}
if (!isset($_POST['offset'])) {
    $_POST['offset'] = null;
}
$lc = new LogController();
$lc->dispatch();
class LogController
{
    function LogController()
    {
        $this->table = "log";
        $this->queries = array();
    }
    function dispatch()
    {
        $start = microtime(true);
        $this->link = mysql_pconnect($GLOBALS["db_host"], $GLOBALS["db_user"], $GLOBALS["db_pass"]);
        if (!$this->link) {
            die("Unable to connect to MySQL");
        }
        $this->db = mysql_select_db($GLOBALS["db_db"], $this->link);
        if (!$this->db) {
            die("Unable to select DB.");
        }
        if (isset($_POST['count'])) {