Match() Against() SQL wont accept "" for a phrase (Full Version)

All Forums >> [Web Development] >> ASP and Database



Message


teimky -> Match() Against() SQL wont accept "" for a phrase (4/30/2007 11:08:33)

Hi,

For all you MySQL experts on here may I ask why my match() - against() statement wont let me put double quotes in to make it a phrase match?

Whilst the statement below works it searches for each word individually if a user searches for more than 1 word..

WHERE MATCH(book_title) AGAINST('" & request.form("BOOK_TITLEP")&"'IN BOOLEAN MODE)"

(Therefore a search for "Amber Spyglass" would return
Child in Amber,
Amber Spyglass,
Silver Spyglass)

I want it to only return "Amber Spyglass"
The MySQL manual says to put "" around the against part to treat it as a phrase but this errors:

WHERE MATCH(book_title) AGAINST('" "& request.form("BOOK_TITLEP")&""'IN BOOLEAN MODE)"
I guess it doesnt like two sets of " next to each other?
Any ideas?


Thanks,

Mark.




Spooky -> RE: Match() Against() SQL wont accept "" for a phrase (5/1/2007 12:02:40)

Partially its an asp problem as you arent passing the correct value (double quotes are needed).
Try it this way and see if it works for you?

WHERE MATCH(book_title) AGAINST('"""& request.form("BOOK_TITLEP")&"""' IN BOOLEAN MODE)"




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.0625