Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter 3.1.7 unbuffered_row() returning NULL but row() works
#1

(This post was last modified: 03-10-2018, 11:28 AM by pbarney. Edit Reason: updates )

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?
Reply


Messages In This Thread
CodeIgniter 3.1.7 unbuffered_row() returning NULL but row() works - by pbarney - 03-10-2018, 11:22 AM



Theme © iAndrew 2016 - Forum software by © MyBB