Welcome Guest, Not a member yet? Register   Sign In
Datamapper: Something like where_in_related, but including all
#2

[eluser]avramovic[/eluser]
OK, I did some research and I've found out that I need to make multiple joins of the amenities_properties table for each checkbox checked... something like this:

Code:
...
LEFT JOIN `amenities_properties` ap1 ON `properties`.`id` =
ap1.`property_id`

LEFT JOIN `amenities_properties` ap2 ON `properties`.`id` =
ap2.`property_id`

WHERE
ap1.`amenity_id` = 9 AND
ap2.`amenity_id` = 24

Is this even possible with Datamapper? Or is there another (simpler) way to do this?


Messages In This Thread
Datamapper: Something like where_in_related, but including all - by El Forum - 05-27-2013, 06:59 AM



Theme © iAndrew 2016 - Forum software by © MyBB