[eluser]Unknown[/eluser]
French :
Bonjour,
je souhaite réaliser une requête de recherche qui va rechercher un post en filtrant sur une catégorie sélection avant.
La recherche se fera sur le nom et le content.
Voici ce que je souhaite obtenir :
English :
Hello,
I want to make a search query that will search by filtering a post on a category selection before.
The research will be on name and content.
Here's what I want to:
Code:
SELECT *
FROM posts
WHERE posts.categoryid = '15'
AND namepost LIKE '%là%'
OR posts.categoryid = '15'
AND content LIKE '%là%'
J'ai essayer avec active record :
Code:
$this->db->where($conditions);
$this->db->like('namepost', $champsSerach);
$this->db->or_like('content', $champsSerach);
$this->db->where($conditions);
Mais j'obtiens :
Code:
SELECT *
FROM posts
WHERE posts.categoryid = '20'
AND posts.categoryid = '20'
AND namepost LIKE '%la%'
OR content LIKE '%la%'
A need your help please because i try lots things with where, or_where, etc.