Hi I can execute my code in my main page but I want to make an include page with all of my function. When I execute this code in the main page that work. But when I try to execute a MySQL request in a function it doesn't work...
include('databaseConnexion.php');
function showFirstname($idUser)
{
$users = $bdd->query("SELECT * FROM user WHERE id = '" . $idUser . "'");
while ($user_info = $users->fetch())
{
echo $user_info['firstname'];
}
}