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

(feature): implemented dynamic socials rendering on home and projects page

This commit is contained in:
2023-11-02 13:43:42 +05:30
parent 7e18620bd8
commit 146c634870
3 changed files with 28 additions and 5 deletions

View File

@@ -27,4 +27,27 @@ function fetch_projects_by_year($conn, $year) {
$result = $conn -> query($sql);
return $result;
}
//function to fetch social link of the given platform
function fetch_social_link($conn, $platform_name) {
$sql = "SELECT link FROM socials WHERE platform = '$platform_name'";
$result = $conn -> query($sql);
if($result -> num_rows > 0){
$row = $result -> fetch_assoc();
return $row['link'];
}
else {
return "#";
}
}
//function to fetch social icon of the given platform
function fetch_social_icon($conn, $platform_name) {
$sql = "SELECT icon FROM socials WHERE platform = '$platform_name'";
$result = $conn -> query($sql);
if($result -> num_rows > 0){
$row = $result -> fetch_assoc();
return $row['icon'];
}
}
?>