From b835a4f3b3f8fccd7ce457d4ab13344d3dcb91a9 Mon Sep 17 00:00:00 2001 From: Chris Buckley Date: Mon, 28 Jan 2013 23:35:13 +0000 Subject: Fix list_fields seek bug On the first list_fields call, the field pointer is moved to the end of the list of fields. This change ensures that the pointer is positioned at the start of the field list before grabbing the names. Signed-off-by: Chris Buckley --- system/database/drivers/mssql/mssql_result.php | 1 + 1 file changed, 1 insertion(+) (limited to 'system/database/drivers/mssql') diff --git a/system/database/drivers/mssql/mssql_result.php b/system/database/drivers/mssql/mssql_result.php index ea3f8e4d1..b6e5f2b17 100644 --- a/system/database/drivers/mssql/mssql_result.php +++ b/system/database/drivers/mssql/mssql_result.php @@ -74,6 +74,7 @@ class CI_DB_mssql_result extends CI_DB_result { public function list_fields() { $field_names = array(); + mssql_field_seek($this->result_id, 0); while ($field = mssql_fetch_field($this->result_id)) { $field_names[] = $field->name; -- cgit v1.2.3-24-g4f1b