Add information to a csv_from_result that doesnt appear in the database - 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: Add information to a csv_from_result that doesnt appear in the database (/showthread.php?tid=20604) |
Add information to a csv_from_result that doesnt appear in the database - El Forum - 07-15-2009 [eluser]nigelb[/eluser] I have a export that needs to have a number in a column (same number for every row) that needs to be added to a csv from result but the number doesnt exist in the database. Is there a way I can do a select and add the number into a column in the results Add information to a csv_from_result that doesnt appear in the database - El Forum - 07-15-2009 [eluser]kgill[/eluser] If it's the same number for every row then yes, just select a string. e.g. select '123' as name_for_your_number, column_1, column_2, etc. Add information to a csv_from_result that doesnt appear in the database - El Forum - 07-15-2009 [eluser]nigelb[/eluser] perfect, thanks very much. CI code I am now using is: Code: $this->db->select("'1701' as `field2`", FALSE); |