Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Search multiple queries oninner join table

Attached image is the inner join table. I want to make a search on the inner join table, between Title, Description and also the companyName. I not sure what is wrong with the query and please advise.

The results of table i'm searching on

SELECT campaign.name AS campaignTitle, campaign.desc AS campaignDesc, 
users.name AS companyName
FROM campaign
INNER JOIN users
ON campaign.userId=users.id
WHERE campaign.name like '%"Mia"%'
OR campaign.desc like '%"dolo"%'
OR users.name like '%"iT"%'

I'm newbie in doing the search function. Is there any more effective method to performs such a search? Please advise. Thanks

Update

The result returns nothing from the query above

like image 461
Cheam Huoy San Avatar asked Feb 08 '26 03:02

Cheam Huoy San


1 Answers

Try executing your query without where condition and you should be getting a result set as I don't find any syntax errors.

If you are getting result set, check if your where condition is getting satisfied for any of the rows in the result set.

Break down your query and go step by step to analyse further on why there is no data returned from query.

like image 169
PK20 Avatar answered Feb 12 '26 04:02

PK20



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!