[eluser]blorriman[/eluser]
I'm trying to find a keyword ($keywords) in 2 different fields of the same table, but I need to join the table with another one to get more info, but when I try to use a where statement for the group_id it seems to ignore it. Here's the code :
Code:
function topics($keywords) {
$query = $this->DB2->query("SELECT
meetings.startdate,
agendas.topic,
agendas.preamble,
meetings.group_id,
agendas.mtg_id
FROM
agendas
Inner Join meetings ON agendas.mtg_id = meetings.id
WHERE
agendas.topic LIKE '%" . $keywords . "%' OR
agendas.preamble LIKE '%" . $keywords . "%' AND
meetings.group_id = " . $this->group_id . "");
return $query;
}
Any suggestions would be greatly appreciated - Thanks.