the directory structure is as it follows
--includes/connection.php
--includes/functions.php
index.php
in the index file the code is
require('includes/connection.php');
require('includes/functions.php');
in functions.php i required once connection.php, the function within the functions file is
function getUserInfos($someId) {
global $link;
$getUserInfos = mysqli_query($link, "SELECT * FROM users WHERE userId = {$someId}");
$getUserInfos = $getUserInfos->fetch_assoc();
return $getUserInfos['userId'];
}
in index file i want to echo the user's id but i get a blank response heres the code
<?php echo getUserInfos($someId); ?>