Hi,
I am trying to run this code on the Linux box...
I am getting the following error....
Fatal error: Call to a member function fetchAll() on a non-object in /usr/local/apache2/htdocs/zonebee/dev/PDORohit/pdosample2.php on line 15
Any thoughts?
Regards,
Rohit
I am trying to run this code on the Linux box...
Code:
<?php
// create a SQLite3 database file with PDO and return a database handle (Object Oriented)
try{
$dbHandle = new PDO('sqlite:test.db');
}catch( PDOException $exception ){
die($exception->getMessage());
}
// check if table/s needs to be created (PDO)
$statement = $dbHandle->query('SELECT * FROM trace');
$result = $statement->fetchAll();
if( sizeof($result) == 0 ){
echo 'No database table/s found.';
}
?>
Fatal error: Call to a member function fetchAll() on a non-object in /usr/local/apache2/htdocs/zonebee/dev/PDORohit/pdosample2.php on line 15
Any thoughts?
Regards,
Rohit
Comment