function query($sql, $params = array())
    {
        $db = Neuron_DB_Database::getInstance ();
        $sql = $this->printf ($sql, $params);

        if ($this->debug)
        {
            echo $sql . "<br><br>";
        }

        try
        {
            //echo $sql . "<br><br>";

            $data = $db->query ($sql);

            if ($this->debug)
            {
                echo '<pre>';
                var_dump ($data);
                echo "</pre><br><br>";
            }

            $this->error = false;
            return $data;
        }
        catch (Exception $e)
        {
            $this->error = true;
            echo 'error';
        }
    }