Answer the question
In order to leave comments, you need to log in
How to implement search by several keywords in the database?
How to implement search by multiple keywords from a table.
Requires sorting by time and a certain amount.
I am using redbeanphp.
I do a single label search like this:
$posts_labels = R::findAll('postslabels', 'label = ? ORDER BY `time` DESC LIMIT {$start},{$end}', [$search_text]);
$posts = [];
foreach ($posts_labels as $value) {
$id = $value->post_id;
$post = R::findOne('posts', "id = ?", [$id]);
$posts[] = $post;
}
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