11-17-2016, 09:27 PM
Ok...so if you need to search the entire database at once and you need to be able to search for things that were put in via checkboxes, then I think the best thing is to change those checkboxes from 0 and 1 to unique names for on and off.
Then you're going to want something like this...it's not exact, but it will point you in the right direction.
That's the search...then you have to generate your table of results...
//table of results goes here
Then you're going to want something like this...it's not exact, but it will point you in the right direction.
Code:
if(isset($_POST['search'])){
Code:
$query = Input::get('input');
Code:
$query = htmlspecialchars($query);
Code:
$searchQ = $db->query("SELECT * FROM users WHERE over_18 LIKE '{3bc1fe685386cc4c3ab89a3f76566d8931e181ad17f08aed9ad73b30bf28114d}$query{3bc1fe685386cc4c3ab89a3f76566d8931e181ad17f08aed9ad73b30bf28114d}' OR love_us LIKE '{3bc1fe685386cc4c3ab89a3f76566d8931e181ad17f08aed9ad73b30bf28114d}$query{3bc1fe685386cc4c3ab89a3f76566d8931e181ad17f08aed9ad73b30bf28114d}'
Code:
OR am_human LIKE '{3bc1fe685386cc4c3ab89a3f76566d8931e181ad17f08aed9ad73b30bf28114d}$query{3bc1fe685386cc4c3ab89a3f76566d8931e181ad17f08aed9ad73b30bf28114d}'");
Code:
$results = $searchQ->results();
Code:
$count = $searchQ->count();
Code:
}
That's the search...then you have to generate your table of results...
Code:
if(isset($count) && $count>0){
Code:
foreach ($results as $result) {
//table of results goes here