[eluser]JanDoToDo[/eluser]
Hey guys.
Have this query:
"SELECT * FROM product_info AS p JOIN product_info_detail AS pd ON p.product_id = pd.product_id WHERE p.active = 1 AND pd.language_id = 2 AND (p.product_id LIKE '%".$term."%' OR pd.title LIKE '%".$term."%' OR pd.description LIKE '%".$term."%')"
and would like it in AR format
I tried:
Code:
$query = $this -> db -> from('product_info AS p')
-> join('product_info_detail AS pd', 'p.product_id = pd.product_id')
-> where('p.active', 1)
-> where('pd.language_id', $lang)
-> like('p.product_id', $term)
-> or_like('pd.title', $term)
-> or_like('pd.description', $term)
-> get();
but it didnt work because i needed brackets around the like conditions as otherwise it doesnt pick up the language condition. Is there any way to do this?