summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/mysql/mysql_result.php
diff options
context:
space:
mode:
authorChris Buckley <chris@cmbuckley.co.uk>2013-01-29 00:35:13 +0100
committerChris Buckley <chris@cmbuckley.co.uk>2013-01-29 00:54:24 +0100
commitb835a4f3b3f8fccd7ce457d4ab13344d3dcb91a9 (patch)
treef0ee86528a2672ffea5444f5bc6a41eff0ccce2f /system/database/drivers/mysql/mysql_result.php
parent7bea4fb8a880d774f7b399f8c2cbcd75ce85123c (diff)
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 <chris@cmbuckley.co.uk>
Diffstat (limited to 'system/database/drivers/mysql/mysql_result.php')
-rw-r--r--system/database/drivers/mysql/mysql_result.php1
1 files changed, 1 insertions, 0 deletions
diff --git a/system/database/drivers/mysql/mysql_result.php b/system/database/drivers/mysql/mysql_result.php
index 1ed2759b6..a2affcb58 100644
--- a/system/database/drivers/mysql/mysql_result.php
+++ b/system/database/drivers/mysql/mysql_result.php
@@ -89,6 +89,7 @@ class CI_DB_mysql_result extends CI_DB_result {
public function list_fields()
{
$field_names = array();
+ mysql_field_seek($this->result_id, 0);
while ($field = mysql_fetch_field($this->result_id))
{
$field_names[] = $field->name;