I know the output of an execute statement is a bool. But then how do you get the result of a SELECT statement like below?
<?php
/* Execute a prepared statement by passing an array of insert values */
$calories = 150;
$colour = 'red';
$sth = $dbh->prepare('SELECT name, colour, calories
FROM fruit
WHERE calories < :calories AND colour = :colour');
$sth->execute(array(':calories' => $calories, ':colour' => $colour));
?>
$sth will be either TRUE or FALSE. What I'm interested in is the return rows containing the name, colour and etc.
Thanks!