I have a database, test.db, with a table called Events. I tried this:
<?php
try
{
// open the database
$database = new PDO('sqlite:test.db');
$result = $db->query('SELECT * FROM Events');
foreach($result as $row)
{
// both of these lines produce a blank page
//echo $row['EventName'] . ' | ' . $row['Location'];
echo $row;
}
}
catch(Exception $e)
{
die('Could not connect to database.');
}
?>
but the resulting page is blank. Can anyone see anything wrong with my syntax?
Thanks,
David