![]() |
Active Queries problem - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: Active Queries problem (/showthread.php?tid=62380) |
Active Queries problem - codebigneer - 07-08-2015 Here is my query Code: $this->db->select('amount AS SavingAmount'); On checking in browser its generating this query below Code: SELECT *, *, `amount` AS SavingAmount FROM (`cashman_trial_balance`) WHERE `category_id` = '176' AND `clientId` = '122' AND `year` = '2015/2016' I dont know from where the two stars coming from? Controller code Code: $som_var = $this->client->statistics(); Model code Code: function statistics() RE: Active Queries problem - gadelat - 07-08-2015 I don't think this is the code which causes problem. Try this and I bet you will see double * there anyway. PHP Code: function get_balances() RE: Active Queries problem - codebigneer - 07-08-2015 (07-08-2015, 07:38 AM)gadelat Wrote: I don't think this is the code which causes problem. Try this and I bet you will see double * there anyway. I am using 2.x last version But thanks for you reply , I configured the error its due to db prefix if I am using the db prefix as "abc" then every active query has double * but when I use abc_ then there is only one * and the query runs fine. May be this proble be in 3.x version also. RE: Active Queries problem - mwhitney - 07-09-2015 Even one * indicates that some code in your application which you have not included here is changing your database query. This behavior is not caused by CodeIgniter itself in either version 2 or 3. RE: Active Queries problem - codebigneer - 07-15-2015 Same problem appears again Here what I am doing model.php Code: function a() The above code ouputs Code: SELECT *, * FROM (`cashman_trial_balance`) WHERE `clientId` = '145' AND `category_id` = 174 AND `year` = '2014/2015' The two stars causes the query to break. RE: Active Queries problem - mwhitney - 07-15-2015 Do you have a call to $this->db->start_cache() somewhere that you're not showing here? Has your database library been modified in any way? Are you using a third party database driver? These are pretty much the only things I can think of that would cause this behavior. |