<off-topic> @engg08082 when you post code in the forum, you need to format it. To do so you can either select all the code and click the </> button, or type 3 backticks ``` on a separate line both before and after the code block. </off-topic>
The problem you have there is that you’re only supplying one parameter to the query, regardless of how many parameters you actually create in the query. And, the one parameter you do supply doesn’t exist by the time you actually get to using it - it only has scope within your foreach() loop.
I would suggest that you build an array based on your $search_exploded array, or just use that array and add the leading and trailing % symbols to each element.