irm-1.6-b3/MDB/mysql.php
/**
     * Send a query to the database and return any results
     *
     * @access public
     *
     * @param string  $query  the SQL query
     * @param mixed   $types  array that contains the types of the columns in
     *                        the result set
     *
     * @return mixed a result handle or MDB_OK on success, a MDB error on failure
     */
Send a query to the database and return any results
@access public

@param string  $query  the SQL query
@param mixed   $types  array that contains the types of the columns in
the result set

@return mixed a result handle or MDB_OK on success, a MDB error on failure
Send a query to the database and return any results @access public @param string $query the SQL query @param mixed $types array that contains the types of the columns in the result set @return mixed a result handle or MDB_OK on success a MDB error on failure
function query($query, $types = NULL)
    {
        $this->debug("Query: $query");
        $ismanip = MDB::isManip($query);
        $this->last_query = $query;
        $first = $this->first_selected_row;
        $limit = $this->selected_row_limit;
        $this->first_selected_row = $this->selected_row_limit = 0;
        $result = $this->connect();
        if (MDB::isError($result)) {
            return($result);
        }
        if($limit > 0) {
            if ($ismanip) {
                $query .= " LIMIT $limit";
            } else {
                $query .= " LIMIT $first,$limit";
            }
        }
        if ($this->database_name) {
            if(!@mysql_select_db($this->database_name, $this->connection)) {
                return($this->mysqlRaiseError());
            }
        }
        if ($result = @mysql_query($query, $this->connection)) {
            if ($ismanip) {
                $this->affected_rows = @mysql_affected_rows($this->connection);
                return(MDB_OK);
            } else {
                $result_value = intval($result);
                $this->highest_fetched_row[$result_value] = -1;
                if ($types != NULL) {
                    if (!is_array($types)) {
                        $types = array($types);
                    }
                    if (MDB::isError($err = $this->setResultTypes($result, $types))) {
                        $this->freeResult($result);
                        return($err);
                    }
                }
                return($result);
            }
        }
        return($this->mysqlRaiseError());
    }
function query ( $ query , $ types = NULL ) { $ this -> debug ( " Query:  $ query " ) ; $ ismanip = MDB :: isManip ( $ query ) ; $ this -> last_query = $ query ; $ first = $ this -> first_selected_row ; $ limit = $ this -> selected_row_limit ; $ this -> first_selected_row = $ this -> selected_row_limit = 0 ; $ result = $ this -> connect ( ) ; if ( MDB :: isError ( $ result ) ) { return ( $ result ) ; } if ( $ limit > 0 ) { if ( $ ismanip ) { $ query .= "  LIMIT  $ limit " ; } else { $ query .= "  LIMIT  $ first , $ limit " ; } } if ( $ this -> database_name ) { if ( ! @ mysql_select_db ( $ this -> database_name , $ this -> connection ) ) { return ( $ this -> mysqlRaiseError ( ) ) ; } } if ( $ result = @ mysql_query ( $ query , $ this -> connection ) ) { if ( $ ismanip ) { $ this -> affected_rows = @ mysql_affected_rows ( $ this -> connection ) ; return ( MDB_OK ) ; } else { $ result_value = intval ( $ result ) ; $ this -> highest_fetched_row [ $ result_value ] = - 1 ; if ( $ types != NULL ) { if ( ! is_array ( $ types ) ) { $ types = array ( $ types ) ; } if ( MDB :: isError ( $ err = $ this -> setResultTypes ( $ result , $ types ) ) ) { $ this -> freeResult ( $ result ) ; return ( $ err ) ; } } return ( $ result ) ; } } return ( $ this -> mysqlRaiseError ( ) ) ; }
Send a query to the database and return any results
 @access public
Send a query to the database and return any results @access public