Quantcast
Channel: CodeIgniter Forums - All Forums
Viewing all articles
Browse latest Browse all 14115

CodeIgniter 3.1.7 unbuffered_row() returning NULL but row() works

$
0
0
I am attempting to output a CSV from a query result. dbutil->csv_from_result() should work, but it only returns the column headers. No data is included.

I tracked it down to system/database/DB_utility.php which uses unbuffered_row().

Any calls to unbuffered_row() return `NULL`. If I change it to row(), I get a result. It makes no difference if I use unbuffered_row('array') or unbuffered_row('object')`. In fact, row('array') doesn't seem to work either.

Why does row() work but unbuffered_row() does not?

What am I missing?

EDIT: Okay, the problem seems to be that I called $query->result() prior to calling dbutil->csv_from_result().

New question: Is there a way to display the results of a query and simultaneously save the CSV of results without having to run the query twice?

Viewing all articles
Browse latest Browse all 14115

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>