0

I just wonder, why the $query->list_fields() method throws an empty array if i enable the DB query caching.This is actually a Codeigniter Method to get query fields names.

But at the same time, It works fine if i do not enable db query caching. This issue is also in Windows server, so i believe Environment doesn't matter at all.

Also, i have checked with MySQL native function "mysqli_fetch_field" to get field name in both server (Linux and Windows). It works fine. So i believe the issue only with Db query caching.

For your information, I am using Codeigniter Version 3.

Ref: Codeigniter $this->list_fields

Any help would be appreciated.

Raja
  • 3,477
  • 12
  • 47
  • 89
  • check this [link](http://stackoverflow.com/questions/13676279/codeigniter-list-fields) – Saty Sep 16 '15 at 10:50

1 Answers1

0

Excerpt from documentation:

Not All Database Functions Work with Caching

Lastly, we need to point out that the result object that is cached is a simplified version of the full result object. For that reason, some of the query result functions are not available for use.

The following functions ARE NOT available when using a cached result object:

num_fields()
field_names()
field_data()
free_result()

Also, the two database resources (result_id and conn_id) are not available when caching, since result resources only pertain to run-time operations.

roel
  • 1,640
  • 14
  • 13