helper to generate query results in csv format |
[eluser]Unknown[/eluser]
Hi friends, I have written a helper database_helper to convert query result in the csv string which can be downloaded by calling the download helper after that. 1. generate query result from $query=$this->db->query($querystmt); 2. call the helper $this->load->helper('database'); 3. $outdata=create_csv_query($runquery); 4. Download the $outdata in a .csv file using the download helper. Attached is the helper file. Request you to kindly check and let me know if any errors are there or anyway I can enhance this. Regards, Anubhav Jha I am not able to upload the helper file either in php text or html format the code is Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); Do let me know how can I upload php/text files in future.
[eluser]danmontgomery[/eluser]
This is built into the dbutil class: http://ellislab.com/codeigniter/user-gui...ities.html
[eluser]Unknown[/eluser]
Thank you, I never knew it since I am a newbie, is there anyway I can delete this post. Thanks, Anubhav Jha
[eluser]Unknown[/eluser]
Hi guys, there are some option for dbutil->csv_from_result() where I can set the output without column header? Thanks.- |
Welcome Guest, Not a member yet? Register Sign In |