mirror of
https://github.com/neosubhamoy/neosubhamoy-portfolio.git
synced 2025-12-19 13:33:01 +05:30
(feat): added query function to fetch a single record
This commit is contained in:
@@ -6,6 +6,13 @@ function fetch_all_records($conn, $table_name) {
|
|||||||
return $result;
|
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 to create an array of all unique project years
|
||||||
function create_project_years_array($conn) {
|
function create_project_years_array($conn) {
|
||||||
$sql = "SELECT DISTINCT year FROM projects ORDER BY year DESC";
|
$sql = "SELECT DISTINCT year FROM projects ORDER BY year DESC";
|
||||||
|
|||||||
Reference in New Issue
Block a user