Active Queries problem |
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()
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()
(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.
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.
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.
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. |
Welcome Guest, Not a member yet? Register Sign In |