I'm connecting to a BD to get some data using PHP. I'm using the following code to get data from users table:
if ($query = $db -> prepare ("SELECT id, name, email, password FROM `users` WHERE email = ?")) {
$query -> bind_param('s',$email);
$query -> execute();
$row = $query-> fetch();
$columnas = $query-> num_rows;
if ($row) {
echo 'row es true';
}
if (!$row) {
echo 'row es false';
}
Everything works good but I get a boolean value of $row (True if I have any result, False If not). I would like to get for example the value password of my query but I can't.
What am I doing wrong?