CodeIgniter Forums
possible to use csv_from_result on a non object? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: possible to use csv_from_result on a non object? (/showthread.php?tid=52336)



possible to use csv_from_result on a non object? - El Forum - 06-06-2012

[eluser]hamobi[/eluser]
I am making a query and getting result_array

however after I get my array I am iterating through it to add a few new keys and values. I need to output this to csv, but the 'csv_from_result' function only accepts the $this-db->get() object. I have tried converting my array to an object using some functions I googled but nothing is doing the trick.

I keep getting the error 'must submit valid object' or whatnot. Anyone have experience with this?


possible to use csv_from_result on a non object? - El Forum - 06-06-2012

[eluser]hamobi[/eluser]
i ended up using this function instead

http://www.codehive.net/PHP-Array-to-CSV-1.html