1
1
mirror of https://github.com/neosubhamoy/neosubhamoy-portfolio.git synced 2025-12-20 02:19:34 +05:30

(feat): added fetch quick action link query function and client json dataset

This commit is contained in:
2024-02-01 22:22:26 +05:30
parent 51b3dc4fd8
commit 2416cfae1f
4 changed files with 30 additions and 7 deletions

View File

@@ -6,13 +6,6 @@ function fetch_all_records($conn, $table_name) {
return $result;
}
//function to fetch a single record of the given table, cloumn and it's value
function fetch_a_record($conn, $table_name, $column_name, $column_value) {
$sql = "SELECT * FROM $table_name WHERE $column_name = '$column_value'";
$result = $conn -> query($sql);
return $result;
}
//function to create an array of all unique project years
function create_project_years_array($conn) {
$sql = "SELECT DISTINCT year FROM projects ORDER BY year DESC";
@@ -68,6 +61,16 @@ function fetch_page_title($conn, $page_name) {
}
}
//function to fetch page title
function fetch_quick_action_link($conn, $action_name) {
$sql = "SELECT link FROM quick_actions WHERE name = '$action_name'";
$result = $conn -> query($sql);
if($result -> num_rows > 0){
$row = $result -> fetch_assoc();
return $row['link'];
}
}
//---functions to fetch search results starts here---
//from projects table
function fetch_search_results_projects($conn, $keyword) {