csv_from_result only returning column labels |
I'm looking to use CSV from result to produce a CSV file from a query; my code is like this;
PHP Code: $delimiter = ","; and only returns the following Code: "learnerID","NameFirst","NameLast","MobileNumber" Code: array (size=3)
Maybe your sql statement is wrong? You should have somethink like that:
Code: $query = $this->db->query("SELECT learnerID, NameFirst, NameLast, MobileNumber FROM your_table");
(05-05-2017, 01:47 AM)Rufnex Wrote: Maybe your sql statement is wrong? You should have somethink like that: It's like this: PHP Code: ->select('learnerID , NameFirst, NameLast, MobileNumber') Edit: shot in the dark, here's my csv_from_result code. PHP Code: $delimiter = ",";
OK I found my problem, essiently using $query = $this->db->get(); basicly futzes with $query's object and makes it useless for csv_from_result.
OK, that found out I now have an issue as I do not know how to get the query builder to generate an object and not a Missing argument 1 for CI_DB_driver::list_fields() result. I tried using "get_compiled_select" but that doesn't work. I need the query builder to work with CSV_from_result. |
Welcome Guest, Not a member yet? Register Sign In |