function search_admin($q) {
$db = load_db();
$sql = "SELECT keyword FROM keyword WHERE keyword LIKE = '%{$q}%'";
$sql .= " SELECT title, status
FROM title
WHERE CONCAT(title, ' ', status)
LIKE '%{$q}%'";
$sql .= " SELECT first_name, middle_name, last_name, cbemail
FROM employees
WHERE CONCAT(first_name, ' ' , middle_name, ' ' , last_name , ' ' , cbemail)
LIKE '%{$q}%'";
$sql .= " SELECT username FROM users WHERE username LIKE = '%{$q}%'";
$result = $db->multi_query($sql);
// missing code
}
I can't seem to understand the explanation in the php manual. I hope you can englighten me more. This is for a search bar, that if example he will search for "pending". The code will search on 3 tables which is the title, employees and users. Then output the results. Now my problem is what to do after i get the result query :/