I have a textfield where I enter keywords. Once this form is sent through php it queries the database to look for the keywords that exist in one particular field.
e.g.
Let's say I'm looking for the word "widgets".
$keyword = "widgets";
$mysql_data = mysql_query("SELECT text FROM test WHERE text LIKE '%$keyword%'");
It works fine when I search for one single keyword but let's assume I have some words within the "text"-field.
Something like this "this widgets are blue" and the keyword is "blue widgets".
When I query blue widgets it gives me no result but instead it should get me the "this widgets are blue" query since both words (blue, widgets) appear within the same field in my database...
How does my "SELECT" have to be written?
e.g.
Let's say I'm looking for the word "widgets".
$keyword = "widgets";
$mysql_data = mysql_query("SELECT text FROM test WHERE text LIKE '%$keyword%'");
It works fine when I search for one single keyword but let's assume I have some words within the "text"-field.
Something like this "this widgets are blue" and the keyword is "blue widgets".
When I query blue widgets it gives me no result but instead it should get me the "this widgets are blue" query since both words (blue, widgets) appear within the same field in my database...
How does my "SELECT" have to be written?