예제 #1
0
 /**
  * Fetch one fileld from row
  *
  * @param string $field_identifier (both numeric and associative)
  * @param int $is_numeric (For non cached results)(0-$field_identifier is name of the field,1-$field_identifier is number of the field)
  * @return string
  */
 public function fetchField($field_identifier, $is_numeric = 0)
 {
     if ($this->is_result_cached) {
         if (!isset($this->result[$this->last_record_position])) {
             return null;
         }
         if ($is_numeric) {
             $keys = array_keys($this->result[$this->last_record_position]);
             $field = $this->result[$this->last_record_position][$keys[$field_identifier]];
         } else {
             $field = $this->result[$this->last_record_position][$field_identifier];
         }
         $this->last_record_position++;
         return $field;
     } else {
         return parent::fetchField($field_identifier, $is_numeric);
     }
 }