| pdo_stored_func2.htm |
Uses:/*** echo number of columns ***/
//$result = $stmt->fetch(PDO::FETCH_NUM);
$result = $stmt->fetch(PDO::FETCH_ASSOC);
// PDO::FETCH_NUM returns the row as a numerical array
/*** loop over the object directly ***/
foreach($result as $key=>$val)
{
echo "function Celsius to Fahrenheit (ºC to ºF) ". $key.' = '.$val.'<br />';
}
|
![]() |
Code
|
| Displaying with Firefox browser:
|
| Using MySQL PHP application:
|
![]() |