Welcome Guest, Not a member yet? Register   Sign In
Need Help With Active Record For Search Function
#6

[eluser]davidbehler[/eluser]
You need to use parenthesis, it should be
Code:
SELECT `JL_customers`.*, `JL_customers_status`.`name` as status_name, `JL_customers_status`.`color` as status_color
FROM (`JL_customers`)
LEFT JOIN `JL_customers_status` ON `JL_customers_status`.`id` = `JL_customers`.`status`
WHERE `assn_location_id` = '203' AND  
(`name_first`  LIKE '%test%'
OR  `name_last`  LIKE '%test%'
OR  `email_home`  LIKE '%test%')
ORDER BY `date_last_modified` desc
The problem is, this cannot be easily achieved active record. You will propably have to use plain old sql for that.


Messages In This Thread
Need Help With Active Record For Search Function - by El Forum - 01-26-2010, 02:50 PM
Need Help With Active Record For Search Function - by El Forum - 01-27-2010, 06:06 AM
Need Help With Active Record For Search Function - by El Forum - 01-27-2010, 08:10 AM
Need Help With Active Record For Search Function - by El Forum - 01-27-2010, 08:27 AM
Need Help With Active Record For Search Function - by El Forum - 01-28-2010, 07:09 AM
Need Help With Active Record For Search Function - by El Forum - 01-28-2010, 07:15 AM
Need Help With Active Record For Search Function - by El Forum - 01-28-2010, 07:21 AM
Need Help With Active Record For Search Function - by El Forum - 01-28-2010, 07:42 AM
Need Help With Active Record For Search Function - by El Forum - 01-28-2010, 07:57 AM



Theme © iAndrew 2016 - Forum software by © MyBB