CodeIgniter 3.1.7 unbuffered_row() returning NULL but row() works |
03-10-2018, 11:22 AM
(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? |
Messages In This Thread |
CodeIgniter 3.1.7 unbuffered_row() returning NULL but row() works - by pbarney - 03-10-2018, 11:22 AM
RE: CodeIgniter 3.1.7 unbuffered_row() returning NULL but row() works - by pbarney - 04-24-2018, 06:46 AM
RE: CodeIgniter 3.1.7 unbuffered_row() returning NULL but row() works - by php_rocs - 04-24-2018, 06:55 AM
RE: CodeIgniter 3.1.7 unbuffered_row() returning NULL but row() works - by pbarney - 04-24-2018, 12:44 PM
RE: CodeIgniter 3.1.7 unbuffered_row() returning NULL but row() works - by Narf - 04-24-2018, 07:10 AM
RE: CodeIgniter 3.1.7 unbuffered_row() returning NULL but row() works - by pbarney - 04-24-2018, 12:40 PM
RE: CodeIgniter 3.1.7 unbuffered_row() returning NULL but row() works - by Narf - 04-25-2018, 06:32 AM
RE: CodeIgniter 3.1.7 unbuffered_row() returning NULL but row() works - by php_rocs - 04-25-2018, 07:41 AM
|