If you wish to query an SQLite database using PHP, you can do so by placing commands similar to those shown below within the code for a webpage:
<?php $filename = "/Users/jasmith1/Documents/www/test/presidents.db"; $db = new SQLite3($filename); $results = $db->query('SELECT * FROM Terms'); while ($row = $results->fetchArray()) { var_dump($row); echo "<br>\n"; } ?>
In the example above, the database location and file name is stored
in the variable $filename
. The file must be in a location
accessible by the webserver and the
file permissions must allow access to the file.
[ More Info ]