prepare("SELECT * FROM klant");
$sth->execute();
// PDOStatement::fetch styles
print("PDO::FETCH_ASSOC: ");
print("Return next row as an array indexed by column name
");
$result = $sth->fetch(PDO::FETCH_ASSOC);
echo "
";
var_dump($result);
echo "
";
print("
");
print("PDO::FETCH_BOTH: ");
print("Return next row as an array indexed by both column name and number
");
$result = $sth->fetch(PDO::FETCH_BOTH);
echo "";
var_dump($result);
echo "
";
print("
");
print("PDO::FETCH_LAZY: ");
print("Return next row as an anonymous object with column names as properties
");
$result = $sth->fetch(PDO::FETCH_LAZY);
echo "";
var_dump($result);
echo "
";
print("
");
print("PDO::FETCH_OBJ: ");
print("Return next row as an anonymous object with column names as properties
");
$result = $sth->fetch(PDO::FETCH_OBJ);
echo "";
var_dump($result);
echo "
";
print $result->naam;
print("
");
?>