I have a query where i am getting informations from contacts table which looks like this

And numbers table which looks like this

Im getting contact information with its numbers while searching currently the code lookslike this
SELECT contacts.id, fname, lname, email, address,uid,uniqid,
group_concat(distinct pnumber order by pnumber) c,cid
FROM contacts
LEFT JOIN numbers
ON contacts.uniqid = numbers.cid
WHERE fname LIKE '%' OR lname LIKE '%' OR pnumber LIKE '%' AND contacts.uid = 8
group by id, fname, lname, email, address, uid, uniqid, cid
Im trying to search for keyword and get only the contacts that belong to that user "uid" which i set 8 for example in here. Apparently it returns this

Why the AND condition doesn't work and how can i get contacts that belong only to specific uid?
Note:Sorry for posting images, there was no way for me to generate ascii for this tables since they are too long