PHP SQL搜索查询匹配

I have a search page in PHP which uses the following query to fetch content from the database.

SELECT * FROM linkBase WHERE (`title` LIKE '%".$s."%') OR (`descr` LIKE '%".$s."%')

Here is how my DB looks like :

id  |title         |descr
-----------------------------------------
1   |Hello World   |This is a hello world description
2   |PiedPiper     |The silicon valley company PiedPiper
3   |StackOverflow |Ask questions on programming

Now, for example, if I run this query with the value of $s = "silicon valley", Then it fetches the row 2. This is fine. But what if the user enters the search term as silicon PiedPiper. It returns no results with the above SQL query. How can I modify the query in such a way that it will return row 2 with the second search term too.

Question summery : How can I do a search query using PHP and SQL in such a way that a result will be returned even if the the user enters two words which are not placed consequent to each other in the DB

LIKE '%{".$s."}%' or to be old school INSTR(title, '{'.$s.'}') > 0

If you need to support an arbitrary order of the words in the search I suggest using the REGEXP MySQL function with a simple "or" regular expression like

SELECT * FROM linkBase WHERE (`title` REGEXP 'silicon|PiedPiper') OR (`descr` REGEXP 'silicon|PiedPiper')

so you can replace the whitespace with PHP and replace them with a pipe symbol (|) and the order of the words don't matter anymore.

This will select all rows that contain at least one of the words, if you need to match all words in the list another regular expression might be necessary.