pdo fetchall as object code example
Example: pdo fetchall as object
prepare("SELECT name, colour FROM fruit");
$sth->execute();
$result = $q->fetchAll(PDO::FETCH_OBJ);
//$result contains an array of stdObjects
?>
prepare("SELECT name, colour FROM fruit");
$sth->execute();
$result = $q->fetchAll(PDO::FETCH_OBJ);
//$result contains an array of stdObjects
?>