1 <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
\r
5 * An open source application development framework for PHP 4.3.2 or newer
\r
7 * @package CodeIgniter
\r
8 * @author ExpressionEngine Dev Team
\r
9 * @copyright Copyright (c) 2008, EllisLab, Inc.
\r
10 * @license http://codeigniter.com/user_guide/license.html
\r
11 * @link http://codeigniter.com
\r
12 * @since Version 1.0
\r
16 // ------------------------------------------------------------------------
\r
19 * MS SQL Result Class
\r
21 * This class extends the parent result class: CI_DB_result
\r
23 * @category Database
\r
24 * @author ExpressionEngine Dev Team
\r
25 * @link http://codeigniter.com/user_guide/database/
\r
27 class CI_DB_mssql_result extends CI_DB_result {
\r
30 * Number of rows in the result set
\r
37 return @mssql_num_rows($this->result_id);
\r
40 // --------------------------------------------------------------------
\r
43 * Number of fields in the result set
\r
48 function num_fields()
\r
50 return @mssql_num_fields($this->result_id);
\r
53 // --------------------------------------------------------------------
\r
58 * Generates an array of column names
\r
63 function list_fields()
\r
65 $field_names = array();
\r
66 while ($field = mssql_fetch_field($this->result_id))
\r
68 $field_names[] = $field->name;
\r
71 return $field_names;
\r
74 // --------------------------------------------------------------------
\r
79 * Generates an array of objects containing field meta-data
\r
84 function field_data()
\r
87 while ($field = mssql_fetch_field($this->result_id))
\r
89 $F = new stdClass();
\r
90 $F->name = $field->name;
\r
91 $F->type = $field->type;
\r
92 $F->max_length = $field->max_length;
\r
93 $F->primary_key = 0;
\r
102 // --------------------------------------------------------------------
\r
109 function free_result()
\r
111 if (is_resource($this->result_id))
\r
113 mssql_free_result($this->result_id);
\r
114 $this->result_id = FALSE;
\r
118 // --------------------------------------------------------------------
\r
123 * Moves the internal pointer to the desired offset. We call
\r
124 * this internally before fetching results to make sure the
\r
125 * result set starts at zero
\r
130 function _data_seek($n = 0)
\r
132 return mssql_data_seek($this->result_id, $n);
\r
135 // --------------------------------------------------------------------
\r
138 * Result - associative array
\r
140 * Returns the result set as an array
\r
145 function _fetch_assoc()
\r
147 return mssql_fetch_assoc($this->result_id);
\r
150 // --------------------------------------------------------------------
\r
155 * Returns the result set as an object
\r
160 function _fetch_object()
\r
162 return mssql_fetch_object($this->result_id);
\r
168 /* End of file mssql_result.php */
\r
169 /* Location: ./system/database/drivers/mssql/mssql_result.php */