SQL subquery using active record |
[eluser]Raymondddd[/eluser]
Hi, I need to use a subquery to get the information i want. Currently im using active record for my query so i use this method: http://shawnmccool.com/2009/09/18/using-...ubqueries/ My subquery: Code: $this->db->select('f.price'); p.product_id comes from my main query. This is not working because active record sees 'p.product_id' as a string. But this have to be the id from my main query. When i output the whole query you also see the quotes: Code: SELECT `p`.`product_id`, `p`.`product_name`, `p`.`product_image`, `p`.`product_model`, (SELECT `f`.`price` I need to remove the quotes in my subquery. What are my possibilities to solve this problem? Looking forward! Raymond Edit: in this case, i noticed $this->db->query will not work in the subquery.
[eluser]Raymondddd[/eluser]
Hmm many thanks Joost. Think that simple thing is all i need!
[eluser]JoostV[/eluser]
Well, you're not alone. That one has cost us all many headaches |
Welcome Guest, Not a member yet? Register Sign In |