mirror of
https://github.com/neosubhamoy/neosubhamoy-portfolio.git
synced 2025-12-19 20:33:06 +05:30
(refactor): using fetch_all_reacords() function + (feature): implemented dynamic currently working on section
This commit is contained in:
@@ -1,4 +1,11 @@
|
||||
<?php
|
||||
//function to fetch all records of the given table
|
||||
function fetch_all_records($conn, $table_name) {
|
||||
$sql = "SELECT * FROM $table_name";
|
||||
$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";
|
||||
@@ -20,11 +27,4 @@ function fetch_projects_by_year($conn, $year) {
|
||||
$result = $conn -> query($sql);
|
||||
return $result;
|
||||
}
|
||||
|
||||
//function to fetch all featured projects
|
||||
function fetch_featured_projects($conn) {
|
||||
$sql = "SELECT * FROM featured_projects";
|
||||
$result = $conn -> query($sql);
|
||||
return $result;
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user