I am using in CRUD the and_where_open() method as per the docs (http://fuelphp.com/docs/packages/orm/crud.html#/complex_wheres) along with a has_many related query and a limit().
I have noticed that this isnt always returning me the correct result set.
When looking at the query the 'where' clauses inside the subquery are not being set at all meaning that the whole dataset is returned while retaining the limit/offset
SELECT `t0`.`things` AS `t0_c0` FROM (SELECT `t0`.`things` FROM `table` AS `t0` WHERE `t0`.`disabled` = 0 ORDER BY `t0`.`created_at` DESC LIMIT 20 OFFSET 0) AS `t0` LEFT JOIN `table_2` AS `t1` ON (`t0`.`id` = `t1`.`id`) WHERE `title` LIKE '%my_string%' OR `t0`.`year` = '%my_string%' ORDER BY `t0`.`created_at` DESC
as you can see in the above query that CRUD makes, in the subquery it will get all the results without my where clause but still applying a limit and then it will apply the where clause outside the subquery meaning that my dataset is not complete.
It looks like you're new here. If you want to get involved, click one of these buttons!