Answer the question
In order to leave comments, you need to log in
How to implement multi-value search in php?
The search form has several lines, something like this id, name, description, date
. For example, I want to search by these parameters. I am getting parameters. And sql looks like this.
select * from `table` where `id` = ? and `name` = ? and `description` = ? and `date` = ?
select * from `table` where `name` = ? and `description` = ? and `date` = ?
if($id='не искать'){
select * from `table` where `name` = ? and `description` = ? and `date` = ?
}
Is this the same way, or is there a better practice? I do this in Laravel, but I think the philosophy of the solution is the same in the code, or is there another solution in laravel?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question