CI_DB_result::set_row PHP Method

set_row() public method

Assigns an item into a particular column slot
public set_row ( mixed $key, mixed $value = NULL ) : void
$key mixed
$value mixed
return void
    public function set_row($key, $value = NULL)
    {
        // We cache the row data for subsequent uses
        if (!is_array($this->row_data)) {
            $this->row_data = $this->row_array(0);
        }
        if (is_array($key)) {
            foreach ($key as $k => $v) {
                $this->row_data[$k] = $v;
            }
            return;
        }
        if ($key !== '' && $value !== NULL) {
            $this->row_data[$key] = $value;
        }
    }