Fatal error: Call to undefined method CI |
(09-15-2017, 06:39 AM)stckitbr Wrote: Hi guys, I'm having this problem when trying to generate an excel file with the data that is displayed on the screen. Clicking will show this error. Try this Code: $query_str="whatever your sql query maybe"; The snippet will get your result array and write to csv file. Just make sure you set correct permission on 'file.csv'. Also on query_str if you need to pass on param within the sql statement then you need to use $this->db->escape($param), e.t.c You can use active record method as per doc it will auto escape the param for you , how you want to write it is up to you Regards |
Messages In This Thread |
Fatal error: Call to undefined method CI - by stckitbr - 09-15-2017, 06:39 AM
RE: Fatal error: Call to undefined method CI - by rtenny - 09-15-2017, 07:47 AM
RE: Fatal error: Call to undefined method CI - by Narf - 09-15-2017, 07:59 AM
RE: Fatal error: Call to undefined method CI - by stckitbr - 09-15-2017, 09:27 AM
RE: Fatal error: Call to undefined method CI - by ciadvantage - 09-16-2017, 08:05 AM
RE: Fatal error: Call to undefined method CI - by Gustavo Martins - 09-19-2017, 06:30 PM
|