Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php print fetch


<?php
$sth = $dbh->prepare("SELECT name, colour FROM fruit");
$sth->execute();

/* Exercise PDOStatement::fetch styles */

print("PDO::FETCH_OBJ: ");
print("Return next row as an anonymous object with column names as properties
");
$result = $sth->fetch(PDO::FETCH_OBJ);
print $result->name;
print("
");
?>

Source by www.php.net #
 
PREVIOUS NEXT
Tagged: #php #print #fetch
ADD COMMENT
Topic
Name
1+3 =