I'm running xampp.
I created a basic db call mydb.sq3 and a basic table called panels. That all seems to work fine because when I call SELECT * FROM panels;
from the command line it is all good. But there is an error that keeps getting thrown when i run my php file:
Fatal error: Call to undefined function query() in > C:\xampp\htdocs\example\myphp.php on line 10
<?php
$db = new SQLite3('mydb.sq3');
$result = $db-->query('SELECT * FROM panels');
while ($row = $result->fetchArray(SQLITE3_ASSOC))
{
echo $row['firstname'] . ': $' . $row['surname'] . '<br/>';
}
unset($db);
?>
Cheers
There is an error in line 3
Use this-
$result = $db->query('SELECT * FROM panels');
Instead of this -
$result = $db-->query('SELECT * FROM panels');
Simple typo error you used '--' instead of '-' Enjoy :)