I'm starting with PDO
and I have a problem I'm following a course which I'm copying everything at the bottom of the letter but it does not return data
when doing a print_r
I returned a 1, and in the database I have 3 users already entered with nombre , email y ID
and the truth is that I do not know what the problem could be, I've seen it again and again, I've tried other ways but the result leads me to it.
Thank you in advance
$conexion = new PDO('mysql:host=localhost;dbname = prueba', 'root', '');
$result = $conexion ->query('SELECT * FROM usuarios');
foreach ($result as $res)
{
echo $res["nombre"]."<br>";
}