1
1
mirror of https://github.com/neosubhamoy/neosubhamoy-portfolio.git synced 2025-12-20 03:29:35 +05:30

(feat): added profiles to search results

This commit is contained in:
2023-11-19 20:46:14 +05:30
parent cf1a410013
commit 348a8d7ea1
3 changed files with 49 additions and 1 deletions

View File

@@ -115,4 +115,20 @@ function fetch_search_results_quickactions($conn, $keyword) {
return array();
}
}
//for quick_actions table
function fetch_search_results_profiles($conn, $keyword) {
$sql = "SELECT * FROM profile WHERE name LIKE '%$keyword%' OR stag LIKE '%$keyword%'";
$result = $conn -> query($sql);
if($result -> num_rows > 0) {
$result = mysqli_fetch_all($result, MYSQLI_ASSOC);
foreach ($result as &$element) {
$element['tag'] = 'profile';
}
return $result;
}
else {
return array();
}
}
?>