/**
  * Get next temporary stats record by load id.
  * @param $loadId string
  * @return mixed array or false if the end of
  * records is reached.
  */
 function getNextByLoadId($loadId)
 {
     if (!$this->_result || $this->_loadId != $loadId) {
         $this->_result = $this->_getGrouped($loadId);
         $this->_loadId = $loadId;
     }
     if ($this->_result->EOF) {
         return false;
     }
     $row = $this->_result->GetRowAssoc(false);
     $this->_result->MoveNext();
     return $row;
 }
Ejemplo n.º 2
0
 function &GetRowAssoc($upper = true)
 {
     if ($this->fetchMode == PGSQL_ASSOC && !$upper) {
         return $this->fields;
     }
     $row =& ADORecordSet::GetRowAssoc($upper);
     return $row;
 }
Ejemplo n.º 3
0
 function GetRowAssoc($upper = true)
 {
     if ($this->fetchMode == MYSQL_ASSOC && !$upper) {
         $row = $this->fields;
     } else {
         $row = ADORecordSet::GetRowAssoc($upper);
     }
     return $row;
 }
Ejemplo n.º 4
0
/**
 * Retrieve the next row returned from a specific database query
 * @param bool|ADORecordSet $p_result Database Query Record Set to retrieve next result for.
 * @return array Database result
 */
function db_fetch_array(&$p_result)
{
    global $g_db, $g_db_type;
    if ($p_result->EOF) {
        return false;
    }
    # mysql obeys FETCH_MODE_BOTH, hence ->fields works, other drivers do not support this
    if ($g_db_type == 'mysql' || $g_db_type == 'odbc_mssql' || $g_db_type == 'mssqlnative') {
        $t_array = $p_result->fields;
        $p_result->MoveNext();
        return $t_array;
    } else {
        $t_row = $p_result->GetRowAssoc(false);
        static $t_array_result;
        static $t_array_fields;
        if ($t_array_result != $p_result) {
            // new query
            $t_array_result = $p_result;
            $t_array_fields = null;
        } else {
            if ($t_array_fields === null) {
                $p_result->MoveNext();
                return $t_row;
            }
        }
        $t_convert = false;
        $t_fieldcount = $p_result->FieldCount();
        for ($i = 0; $i < $t_fieldcount; $i++) {
            if (isset($t_array_fields[$i])) {
                $t_field = $t_array_fields[$i];
            } else {
                $t_field = $p_result->FetchField($i);
                $t_array_fields[$i] = $t_field;
            }
            switch ($t_field->type) {
                case 'bool':
                    switch ($t_row[$t_field->name]) {
                        case 'f':
                            $t_row[$t_field->name] = false;
                            break;
                        case 't':
                            $t_row[$t_field->name] = true;
                            break;
                    }
                    $t_convert = true;
                    break;
                default:
                    break;
            }
        }
        if ($t_convert == false) {
            $t_array_fields = null;
        }
        $p_result->MoveNext();
        return $t_row;
    }
}
Ejemplo n.º 5
0
 function GetRowAssoc($upper = ADODB_ASSOC_CASE)
 {
     if ($this->fetchMode == MYSQL_ASSOC && $upper == ADODB_ASSOC_CASE_LOWER) {
         $row = $this->fields;
     } else {
         $row = ADORecordSet::GetRowAssoc($upper);
     }
     return $row;
 }
Ejemplo n.º 6
0
 public function GetRowAssoc($upper = true)
 {
     if ($this->fetchMode == MYSQLI_ASSOC && !$upper) {
         return $this->fields;
     }
     $row = ADORecordSet::GetRowAssoc($upper);
     return $row;
 }
Ejemplo n.º 7
0
 function &GetRowAssoc($upper = true)
 {
     if ($this->fetchMode == MYSQL_ASSOC && !$upper) {
         return $this->fields;
     }
     return ADORecordSet::GetRowAssoc($upper);
 }