Class CI_DB_result - echiong/testRepo GitHub Wiki

##Class CI_DB_result

Database Result Class

This is the platform-independent result class. This class will not be called directly. Rather, the adapter class for the specific database will extend and instantiate it.

	###Direct known subclasses
		<a href="Class CI_DB_cubrid_result.md">CI_DB_cubrid_resultggg</a>, 
		<a href="Class CI_DB_mssql_result.md">CI_DB_mssql_resultggg</a>, 
		<a href="Class CI_DB_mysql_result.md">CI_DB_mysql_resultggg</a>, 
		<a href="Class CI_DB_mysqli_result.md">CI_DB_mysqli_resultggg</a>, 
		<a href="Class CI_DB_oci8_result.md">CI_DB_oci8_resultggg</a>, 
		<a href="Class CI_DB_odbc_result.md">CI_DB_odbc_resultggg</a>, 
		<a href="Class CI_DB_pdo_result.md">CI_DB_pdo_resultggg</a>, 
		<a href="Class CI_DB_postgre_result.md">CI_DB_postgre_resultggg</a>, 
		<a href="Class CI_DB_sqlite_result.md">CI_DB_sqlite_resultggg</a>, 
		<a href="Class CI_DB_sqlsrv_result.md">CI_DB_sqlsrv_resultggg</a>

Category: Database
Author: ExpressionEngine Dev Team
Link: http://codeigniter.com/user_guide/database/
Located at system/database/DB_result.php

##Methods summary


public mixed result ( string $type = 'object' )

Query result. Acts as a wrapper function for the following functions.

Parameters

$type string
can be "object" or "array"

Returns mixed
either a result object or array


public array custom_result_object ( class_name $class_name )

Custom query result.

Parameters

$class_name class_name
A string that represents the type of object you want back

Returns array
of objects


public object result_object ( )

Query result. "object" version.

Returns object


public array result_array ( )

Query result. "array" version.

Returns array


public mixed row ( string $n = 0, string $type = 'object' )

Query result. Acts as a wrapper function for the following functions.

Parameters

$n string

$type string
can be "object" or "array"

Returns mixed
either a result object or array


public object set_row ( mixed $key, mixed $value = NULL )

Assigns an item into a particular column slot

Returns object


public object custom_row_object ( mixed $n, mixed $type )

Returns a single result row - custom object version

Returns object


public object row_object ( mixed $n = 0 )

Returns a single result row - object version

Returns object


public array row_array ( mixed $n = 0 )

Returns a single result row - array version

Returns array


public object first_row ( mixed $type = 'object' )

Returns the "first" row

Returns object


public object last_row ( mixed $type = 'object' )

Returns the "last" row

Returns object


public object next_row ( mixed $type = 'object' )

Returns the "next" row

Returns object


public object previous_row ( mixed $type = 'object' )

Returns the "previous" row

Returns object


public num_rows ( )

The following functions are normally overloaded by the identically named methods in the platform-specific driver -- except when query caching is used. When caching is enabled we do not load the other driver. These functions are primarily here to prevent undefined function errors when a cached result object is in use. They are not otherwise fully operational due to the unavailability of the database resource IDs with cached results.


public num_fields ( )


public list_fields ( )


public field_data ( )


public free_result ( )


protected _data_seek ( )


protected _fetch_assoc ( )


protected _fetch_object ( )

<table class="summary" id="properties">
<caption>Properties summary</caption>
<tr data-order="conn_id" id="$conn_id">
	<td class="attributes"><code>
		public  
		mixed
	</code></td>

	<td class="name">

$conn_id

NULL
#
		<div class="description detailed">
			

		</div>
	</div></td>
</tr>
<tr data-order="result_id" id="$result_id">
	<td class="attributes"><code>
		public  
		mixed
	</code></td>

	<td class="name">

$result_id

NULL
#
		<div class="description detailed">
			

		</div>
	</div></td>
</tr>
<tr data-order="result_array" id="$result_array">
	<td class="attributes"><code>
		public  
		array
	</code></td>

	<td class="name">

$result_array

array()
#
		<div class="description detailed">
			

		</div>
	</div></td>
</tr>
<tr data-order="result_object" id="$result_object">
	<td class="attributes"><code>
		public  
		array
	</code></td>

	<td class="name">

$result_object

array()
#
		<div class="description detailed">
			

		</div>
	</div></td>
</tr>
<tr data-order="custom_result_object" id="$custom_result_object">
	<td class="attributes"><code>
		public  
		array
	</code></td>

	<td class="name">

$custom_result_object

array()
#
		<div class="description detailed">
			

		</div>
	</div></td>
</tr>
<tr data-order="current_row" id="$current_row">
	<td class="attributes"><code>
		public  
		integer
	</code></td>

	<td class="name">

$current_row

0
#
		<div class="description detailed">
			

		</div>
	</div></td>
</tr>
<tr data-order="num_rows" id="$num_rows">
	<td class="attributes"><code>
		public  
		integer
	</code></td>

	<td class="name">

$num_rows

0
#
		<div class="description detailed">
			

		</div>
	</div></td>
</tr>
<tr data-order="row_data" id="$row_data">
	<td class="attributes"><code>
		public  
		mixed
	</code></td>

	<td class="name">

$row_data

NULL
#
		<div class="description detailed">
			

		</div>
	</div></td>
</tr>
</table>
⚠️ **GitHub.com Fallback** ⚠️