Copy link to clipboard
Copied
Dear all,
I have below parameter for search engine, it search only in Name, I have to make it also to search in WebLink?! How to do that?!
SELECT *
FROM WebSite
WHERE Name = MMColParam1
ORDER BY NameID DESC
Please your help ASAP.
Thanks and regards,
FAIZ ALI
Copy link to clipboard
Copied
SELECT *
FROM WebSite
WHERE Name = MMColParam1 OR
WebLink = MMColParam1
ORDER BY NameID DESC
Copy link to clipboard
Copied
NO,It didn't work?!![]()
Syntax error in query expression 'WebName LIKE ? OR WebLink LIKE %MMColParam1% and UserID = ?'.
Copy link to clipboard
Copied
This is Solution
SELECT *
FROM WebName
WHERE (WebName LIKE %MMColParam1% OR WebLink LIKE %MMColParam2% ) and UserID = MMColParam
ORDER BY WebName DESC
Copy link to clipboard
Copied
Yes. That's a completely different query than what you originally asked for thought. Right? Your original query did not use the LIKE predicate or contain the UserID.
Copy link to clipboard
Copied
Just so you know, it would be a good idea to give your MMColParam variables a meaningful name rather than the default Dreamweaver name, it will help you keep track of which variables you're accessing in you queries. Bregent is correct, you wanted to search the same variable by two different fields originally, so an OR would give you that result. If you wanted to match values exactly you would use:
SELECT *
FROM WebName
WHERE WebName = meaningfulVariableName AND WebLink = anotherMeaningfulVariableName
ORDER BY WebName DESC
Your current solution will give you results that include characters before and after your query string, so if variable1 = "website" it would also return "mywebsite", "websiteforyou", etc.
I hope this helps, the only reason I am blathering like this is that I have much less hair from trying to figure all this stuff out and I thought I'd save you some of yours :-).
Tom
Copy link to clipboard
Copied
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more