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';
        }
    }
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';
        }
    }
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' ; } }
Run an SQL query with the specified parameters, if any.

@param string $sql An SQL string with placeholders.  The
placeholders are assumed to be specific to the database engine
for this connection.

@param array $params An array of parameters to insert into the
SQL string using this connection's escaping mechanism.

@return mixed $result The result of calling this connection's
internal query function.  The type of result depends on the
underlying database engine.  This method is usually used when
the result of a query is not important, like a DDL query.
Run an SQL query with the specified parameters if any .