1
2<?php
3$sth = $dbh->prepare("SELECT name, colour FROM fruit");
4$sth->execute();
5
6/* Exercise PDOStatement::fetch styles */
7
8print("PDO::FETCH_OBJ: ");
9print("Return next row as an anonymous object with column names as properties\n");
10$result = $sth->fetch(PDO::FETCH_OBJ);
11print $result->name;
12print("\n");
13?>
14
15