Welcome Guest, Not a member yet? Register   Sign In
Nontrivial active records question
#4

[eluser]german.zvonchuk[/eluser]
Hi, Cristian Gilè.

Thank you, for the help. But I decided that using Active Records it's not possible to generate such a query.

Below is the query which is generated by Active Query using your method:
Code:
SELECT COUNT(*) AS `numrows`
FROM (`item`)
WHERE `id_item_type` = '1'
OR `id_item_type` = '2'
AND `id_item_target` = '1'


And this is what I want the query to be:
Code:
SELECT COUNT(*) AS `numrows`
FROM (`item`)
WHERE (`id_item_type` = '1' OR `id_item_type` = '2')
AND `id_item_target` = '1'


Messages In This Thread
Nontrivial active records question - by El Forum - 01-06-2011, 02:45 AM
Nontrivial active records question - by El Forum - 01-06-2011, 02:48 AM
Nontrivial active records question - by El Forum - 01-06-2011, 04:18 AM
Nontrivial active records question - by El Forum - 01-06-2011, 06:50 AM
Nontrivial active records question - by El Forum - 01-06-2011, 07:02 AM



Theme © iAndrew 2016 - Forum software by © MyBB