![]() |
Active Record and SQL Views - 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: Active Record and SQL Views (/showthread.php?tid=55567) |
Active Record and SQL Views - El Forum - 11-01-2012 [eluser]vickel[/eluser] is there an active record function to create SQL views? something short to substitute e.g. Code: $sql = "CREATE OR REPLACE VIEW my_new_view AS if not, is there a way to combine above $sql syntax with active record? lets say combine Code: $sql = "CREATE OR REPLACE VIEW my_new_view AS" with Code: $this->db->select('*'); and then call it like below: Code: $query = $this->db->get(); Active Record and SQL Views - El Forum - 11-01-2012 [eluser]PhilTem[/eluser] To my knowledge VIEWS as well as REPLACE INTO are not supported by CI's database driver. And as far as I know VIEWS are something MySQL specific so it won't be in the DB driver since this shall be a universal database driver and not tailored to meet one specific db engine ![]() But I may be wrong though (at least with the views are only available in MySQL part) Active Record and SQL Views - El Forum - 11-01-2012 [eluser]vickel[/eluser] thanks, I thought so, as there were no hints in the user manual. I've done it by the traditional way: Code: $sql = "my query string"; |