1.7 Active Record Select |
[eluser]OES[/eluser]
Hi I am having a problem with 1.7 select data with the * statement. Model code. Code: function list_news() Im getting an error. Code: Error Number: 1054 If I edit ci_news to select just one item ie, ci_news.title it works ok. So the * is throwing the error. To say unknown column ci_news is incorrect. If I run a simple query. Code: function list_news() Getting correct results. I have looked in bug tracker and cant see if this is a bug or not. But I have used this type of code on a number of CI projects with no issues. Hope you can advise.
[eluser]AgentPhoenix[/eluser]
There are a few threads where people have brought this up, namely this one where a solution is offered: http://ellislab.com/forums/viewthread/94808/
[eluser]mycroes[/eluser]
+1 on this issue... I'm especially encountering it with the use of tablename.*, where the query will end up as `tablename`.`*`. Quite sloppy to let this slip into release...
[eluser]mycroes[/eluser]
Also this broke the select_sum function: $this->db->select_sum('group_permissions.permission', 'permissions'); $this->db->from('group_permissions'); $this->db->join('group_members', 'group_permissions.group_id = group_members.group_id'); $this->db->where('group_members.user_id', $user); $this->db->where('group_permissions.granted', true); $this->db->group_by('group_permissions.group_id'); results in: SELECT `SUM(`group_permissions`.`permission`)` AS permissions FROM (`group_permissions`) JOIN `group_members` ON `group_permissions`.`group_id` = `group_members`.`group_id` WHERE `group_members`.`user_id` = '57' AND `group_permissions`.`granted` = 1 GROUP BY `group_permissions`.`group_id`; I guess this is fixed with the similar issue reported by someone else... Also when it's fixed I expect my $this->db->select('COUNT(something) AS amount'); to work ![]() |
Welcome Guest, Not a member yet? Register Sign In |