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>
diff --git a/system/database/drivers/mysqli/mysqli_result.php b/system/database/drivers/mysqli/mysqli_result.php
index 4105f99..3fe05f9 100644
--- a/system/database/drivers/mysqli/mysqli_result.php
+++ b/system/database/drivers/mysqli/mysqli_result.php
@@ -74,6 +74,7 @@
public function list_fields()
{
$field_names = array();
+ $this->result_id->field_seek(0);
while ($field = $this->result_id->fetch_field())
{
$field_names[] = $field->name;