PhpDig.net

Go Back   PhpDig.net > PhpDig Forums > How-to Forum

Reply
 
Thread Tools
Old 12-07-2004, 08:43 PM   #1
leonardburton
Green Mole
 
Join Date: Dec 2004
Posts: 10
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
leonardburton is offline   Reply With Quote
Old 12-08-2004, 11:03 AM   #2
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
What about using query_string (make sure it is cleaned/escaped) and use that to query your special table?
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension.
Charter is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
search.php suddenly stops parsing during "extract vars" jackmoring Troubleshooting 1 08-25-2006 11:27 AM
shows blank page if "Search All" and "exact phrase", timeout? alokjain9 Troubleshooting 2 03-07-2006 07:08 AM
"1 1" between page header and search result jensb Troubleshooting 2 01-13-2005 01:37 PM
"search depth" and "links per" features laurentxav How-to Forum 1 01-12-2005 07:27 PM
search for "hold" not matching on the word foothold mingus Troubleshooting 2 06-02-2004 08:54 PM


All times are GMT -8. The time now is 07:42 AM.


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