The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Searching for ""

I'm currently working on a search engine for my website.
To allow people to search with multiple words I have written the following code:

PHP Code:

$keywords_sep = explode(" ", $keywords); foreach($keywords_sep AS $keyword){ $KeyQuery = mysql_query("SELECT * FROM page WHERE (Keywords LIKE '%$keyword%') OR (Title LIKE '%$keyword%') ORDER BY Title");

Pretty straight forward. But I also want to allow the user to enter "'s so it can search for a exact match of a couple of words.

i.e. If you look for Higher Education, in the sample above it gives every page with Higher AND/OR Education. Maybe this user doesn't want to find a page about Kindergarden Education... but it will show up, because one of the keywords is in it.

Now, if someone is searching for Higher Education, he/she should / could add " to the search. i.e. "Higher Education".

Now my question is: How do I check in my search-variable for any occurance of a word between ""? And how do I get it in a separate variable?