Home php строка не найдена

строка не найдена

Author

Date

Category

I do not even know how to ask the question correctly. In general, there is a request, with a search (LIKE) on the table. I have no problem with one value. But before me, it cannot be reached, how to search in this query for several values. That’s what I mean:

There is such a request

select *
From `Table_Text`
Where `Table_Text`. `Text`
Like: text;

It is looking for a definite value. But after I try to make a request that will look for several values, the truth is still not imagine how to implement it. Since I have values ​​from the array, and their number is not always the same. Those. This time the values ​​5, in the other 2, in the following may be at all 20, etc. Therefore, I can not write a request about this:

select *
From `Table_Text`
Where `Table_Text`. `Text`
Like: Text1.
And `Table_Text`. `Text`
Like: Text2.
// etc.

Advise the output. And then I can not imagine how to implement it.


Answer 1, Authority 100%

I would advise you to unload templates in a temporary table. After that, the request becomes simple and understandable. And you can implement logic flexible – and all templates are immediately suitable, and at least one, and at least 2, and strictly 3, and on the contrary, no more than 2 …


Answer 2

So you can simply

select *
from table_text
Join Table On Table_Text.Text Like '%' + Table.text2 + '%'

where table will contain your entire list of

values

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions