PhpDig.net

PhpDig.net (http://www.phpdig.net/forum/index.php)
-   How-to Forum (http://www.phpdig.net/forum/forumdisplay.php?f=33)
-   -   how to do "reverse like" search in mysql? (http://www.phpdig.net/forum/showthread.php?t=1582)

leonardburton 12-07-2004 08:43 PM

how to do "reverse like" search in mysql?
 
Greetings,

Would anyone know if this can be done in an SQL statement?

At the bottom of my PHPDIG search results I have special links inserted for certain queries. I am currently only filtering for certain one word phrases (which was very easy) but I want to have two word + phrases.

For example, if in the MYSQL table I have stored:
one two three

and the PHPDIG search query is:
one two three four

I want it to return the special link for "one two three."

I tried "select link from table where '$query' like keyword" but obviously that didnt work.

Is there a way to do that without having to put all the keywords in an array and loop through it?

Thanks,

Leonard

Charter 12-08-2004 11:03 AM

What about using query_string (make sure it is cleaned/escaped) and use that to query your special table?


All times are GMT -8. The time now is 04:44 PM.

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2001 - 2005, ThinkDing LLC. All Rights Reserved.