Retrieveing data from mysql via PDO object

hello guys,
i am developing my own blog just for the experience .but when it is time for me to retrieve all posts from the post table i am having some trouble with PDO OBJECT to perform the task. i search online for a relevant information but had no hope.

Could anyone give an small example how to retrieve data via PDO object please i will appreciate it alot :slight_smile:

I think you can set it when you intialise PDO but you can do it on a per query basis using the PDOStatement class.

PHP: PDOStatement->fetchAll - Manual


// do your query, then
$stmt = PDO->fetchAll(PDO::FETCH_OBJ);

thanks alot will try it