CI_DB_result

class CI_DB_result

result([$type = 'object'])
Parameters:
  • $type (string) – Type of requested results - array, object, or class name
Returns:

Array containing the fetched rows

Return type:

array

A wrapper for the result_array(), result_object() and custom_result_object() methods.

Usage: see Result Arrays.

result_array()
Returns: Array containing the fetched rows
Return type: array

Returns the query results as an array of rows, where each row is itself an associative array.

Usage: see Result Arrays.

result_object()
Returns: Array containing the fetched rows
Return type: array

Returns the query results as an array of rows, where each row is an object of type stdClass.

Usage: see Result Arrays.

custom_result_object($class_name)
Parameters:
  • $class_name (string) – Class name for the resulting rows
Returns:

Array containing the fetched rows

Return type:

array

Returns the query results as an array of rows, where each row is an instance of the specified class.

row([$n = 0[, $type = 'object']])
Parameters:
  • $n (int) – Index of the query results row to be returned
  • $type (string) – Type of the requested result - array, object, or class name
Returns:

The requested row or NULL if it doesn’t exist

Return type:

mixed

A wrapper for the row_array(), row_object() and ``custom_row_object() methods.

Usage: see Result Rows.

unbuffered_row([$type = 'object'])
Parameters:
  • $type (string) – Type of the requested result - array, object, or class name
Returns:

Next row from the result set or NULL if it doesn’t exist

Return type:

mixed

Fetches the next result row and returns it in the requested form.

Usage: see Result Rows.

row_array([$n = 0])
Parameters:
  • $n (int) – Index of the query results row to be returned
Returns:

The requested row or NULL if it doesn’t exist

Return type:

array

Returns the requested result row as an associative array.

Usage: see Result Rows.

row_object([$n = 0])
Parameters:
  • $n (int) – Index of the query results row to be returned
Returns:

The requested row or NULL if it doesn’t exist

Return type:

stdClass

Returns the requested result row as an object of type stdClass.

Usage: see Result Rows.

custom_row_object($n, $type)
Parameters:
  • $n (int) – Index of the results row to return
  • $class_name (string) – Class name for the resulting row
Returns:

The requested row or NULL if it doesn’t exist

Return type:

$type

Returns the requested result row as an instance of the requested class.

data_seek([$n = 0])
Parameters:
  • $n (int) – Index of the results row to be returned next
Returns:

TRUE on success, FALSE on failure

Return type:

bool

Moves the internal results row pointer to the desired offset.

Usage: see Result Helper Methods.

set_row($key[, $value = NULL])
Parameters:
  • $key (mixed) – Column name or array of key/value pairs
  • $value (mixed) – Value to assign to the column, $key is a single field name
Return type:

void

Assigns a value to a particular column.

next_row([$type = 'object'])
Parameters:
  • $type (string) – Type of the requested result - array, object, or class name
Returns:

Next row of result set, or NULL if it doesn’t exist

Return type:

mixed

Returns the next row from the result set.

previous_row([$type = 'object'])
Parameters:
  • $type (string) – Type of the requested result - array, object, or class name
Returns:

Previous row of result set, or NULL if it doesn’t exist

Return type:

mixed

Returns the previous row from the result set.

first_row([$type = 'object'])
Parameters:
  • $type (string) – Type of the requested result - array, object, or class name
Returns:

First row of result set, or NULL if it doesn’t exist

Return type:

mixed

Returns the first row from the result set.

last_row([$type = 'object'])
Parameters:
  • $type (string) – Type of the requested result - array, object, or class name
Returns:

Last row of result set, or NULL if it doesn’t exist

Return type:

mixed

Returns the last row from the result set.

num_rows()
Returns: Number of rows in the result set
Return type: int

Returns the number of rows in the result set.

Usage: see Result Helper Methods.

num_fields()
Returns: Number of fields in the result set
Return type: int

Returns the number of fields in the result set.

Usage: see Result Helper Methods.

field_data()
Returns: Array containing field meta-data
Return type: array

Generates an array of stdClass objects containing field meta-data.

free_result()
Return type: void

Frees a result set.

Usage: see Result Helper Methods.

list_fields()
Returns: Array of column names
Return type: array

Returns an array containing the field names in the result set.

doc_CodeIgniter
2016-10-15 16:31:24
Comments
Leave a Comment

Please login to continue.