I am trying to make a MySQL query where I filter the records based on the search text using LIKE keyword.
For example if the user searches for Illusion Softwar
you can try this also, this worked for me,
$this->db->or_like('CONCAT(Contacts.FirstName,' ', Contacts.LastName)',$search);
SELECT *,c.ID as CID
FROM Contacts c
LEFT OUTER JOIN website_Data w ON c.ID=w.ContactID
WHERE c.Email OR CONCAT_WS(' ',c.FirstName,c.LastName) LIKE '%Illusion Softwares%'
ORDER BY c.Created DESC;
Your query should be like this
Select Contacts.*, Contacts.ID as CID
from Contacts
left join website_Data
on Contacts.ID = website_Data.ContactID
where CONCAT(Contacts.FirstName,' ', Contacts.LastName) LIKE '%Illusion Softwares%'
order by Contacts.`Created` DESC