]>
jfr.im git - z_archive/KronOS.git/blob - video/system/database/drivers/sqlsrv/sqlsrv_result.php
1 <?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
5 * An open source application development framework for PHP 5.1.6 or newer
8 * @author ExpressionEngine Dev Team
9 * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
10 * @license http://codeigniter.com/user_guide/license.html
11 * @link http://codeigniter.com
16 // ------------------------------------------------------------------------
21 * This class extends the parent result class: CI_DB_result
24 * @author ExpressionEngine Dev Team
25 * @link http://codeigniter.com/user_guide/database/
27 class CI_DB_sqlsrv_result
extends CI_DB_result
{
30 * Number of rows in the result set
37 return @sqlsrv_num_rows($this->result_id
);
40 // --------------------------------------------------------------------
43 * Number of fields in the result set
50 return @sqlsrv_num_fields($this->result_id
);
53 // --------------------------------------------------------------------
58 * Generates an array of column names
63 function list_fields()
65 $field_names = array();
66 foreach(sqlsrv_field_metadata($this->result_id
) as $offset => $field)
68 $field_names[] = $field['Name'];
74 // --------------------------------------------------------------------
79 * Generates an array of objects containing field meta-data
87 foreach(sqlsrv_field_metadata($this->result_id
) as $offset => $field)
90 $F->name
= $field['Name'];
91 $F->type
= $field['Type'];
92 $F->max_length
= $field['Size'];
102 // --------------------------------------------------------------------
109 function free_result()
111 if (is_resource($this->result_id
))
113 sqlsrv_free_stmt($this->result_id
);
114 $this->result_id
= FALSE;
118 // --------------------------------------------------------------------
123 * Moves the internal pointer to the desired offset. We call
124 * this internally before fetching results to make sure the
125 * result set starts at zero
130 function _data_seek($n = 0)
135 // --------------------------------------------------------------------
138 * Result - associative array
140 * Returns the result set as an array
145 function _fetch_assoc()
147 return sqlsrv_fetch_array($this->result_id
, SQLSRV_FETCH_ASSOC
);
150 // --------------------------------------------------------------------
155 * Returns the result set as an object
160 function _fetch_object()
162 return sqlsrv_fetch_object($this->result_id
);
168 /* End of file mssql_result.php */
169 /* Location: ./system/database/drivers/mssql/mssql_result.php */