I'm making a website where multiple users can log in. I logged in but I can not get the other user data that is in the database. How can I do this?
I have the function
$usuario = buscaUsuario($conexao, $_POST['email'], $_POST['senha']);
if($usuario == null) {
header("Location: ../index.php?login==0");
} else {
logaUsuario($usuario['nome']);
header("Location: ../interno/index.php");
}
die();
I also have:
function buscaUsuario($conexao, $email, $senha) {
$query = "select * from usuarios where email='{$email}' and senha='{$senha}'";
$resultado = mysqli_query($conexao, $query);
$usuario = mysqli_fetch_assoc($resultado);
return $usuario;
}
In the logaUsuario($usuario['nome']);
line if I change my name to email or any other data from the database it changes there in my logged_user .... but I can not multiply the logaUsuario ($ user ['name']); to populate the data on the user's profile page