My Question Is About Fetching Data From Database But Displaying Empty Array. I Connected DB by PDO and else you can see in code. Suggestions In Code it will great Help.
try{
$tododb = new PDO('mysql:host = localhost;dbname = mytodo;charset=utf8','root',''); //Connect to the db
$statement = $tododb->prepare('select * from todos');
$statement->execute();
var_dump($statement->fetchAll(PDO::FETCH_OBJ));
}
catch(PDOException $e){
echo 'Exception -> ';
var_dump($e->getMessage());
die();
}