Instead of searching through a single column for query, I would like my Regexp query to refer to several columns in determining the results of a search as well as limit the the extend of its search activity per session the search function is executed ( so for instance, on the first session the search will only look for the first 10, while if the search is prompted a second time then the next 10 will be sought for). The reason for this limited extend is to prevent latency issues in the long run if the database grows.
I am wanting to do this for a camp roster, where non-fixed keywords will determine the group members of registered campers based on searching through two columns: hobbies
and spirit_animal_explanation
for words matching the keywords.
PHP:
$searchCD = "SELECT * FROM users WHERE hobbies AND spirit_animal_explanation REGEXP '".$keywords."' LIMIT 10";
$searchST = $con->query($searchCD);
if ($searchST) {
while ($row = $searchST->fetch_assoc()) {
echo $row["first_name"]. "<br/>" . "<br/>" . $row["hobbies"] . "<br/>" . $row["spirit_animal_explanation"] .
"<br/>" . $row["avatar"] . "<br/><br/>" ;
}
}