With the PDO you can pick up a standard object just by specifying the query's return type PDO::FETCH_OBJ:
$db = new PDO('mysql:host=localhost;dbname=test','usuario','senha');
$sql = "select * from pessoas limit 5";
$stmt = $db->prepare($sql);
$stmt->execute();
$arr = $stmt->fetchAll(PDO::FETCH_OBJ);
The output is an array containing objects of the standard class, the properties will have the same name as the fields that are in the database. Something like this:
[0] => stdClass Object
(
[id_pessoa] => 1
[nomeCompleto] => joão da silva
[idade] => 20
)
To access:
echo $pessoa->NomeCompleto .' - ' . $pessoa->idade;