Translate MySQL into active record, how? - 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: Translate MySQL into active record, how? (/showthread.php?tid=22211) |
Translate MySQL into active record, how? - El Forum - 09-01-2009 [eluser]überfuzz[/eluser] I'm trying to translate MySQL into codeigniters active record. When I'm running a active record query I'm not getting the same result as I'm getting running it as an ordinary sql-query. This i the method I'm tinkering with, it's in a model.php. Code: function get_news() The Mysql looks like this: Code: SELECT news.date AS date, news_events.event AS event FROM news The result in phpMyAdmin: Code: date event Result with active record. (It's fetched by a controller and passed to view. Nothing is done to the info in the controller and just test printed with print_r in viewer.): Code: date Could anyone help me and point out what I'm doing wrong here? Translate MySQL into active record, how? - El Forum - 09-01-2009 [eluser]überfuzz[/eluser] Well, if I'd read the manual more closely I would have noticed that the select() function only takes one string. I changed my query like this: Code: FROM :red: |