I'm new to SQLite3 and PHP and was wondering whether and how I could connect to a SQLite3 database with PHP.
How would I get the data from the db and would it be possible to output them on a browser screen? I've been searching the web for a while now, but couldn't find anything.
Thank you.
PHP provides two SQLite extensions by default since version 5.0. The latest SQLite extension is known as sqlite3 extension that is included in PHP 5.3+. The sqlite3 extension provides an interface for accessing SQLite 3.
<?php $db = new SQLite3('mysqlitedb.db'); $results = $db->query('SELECT bar FROM foo'); while ($row = $results->fetchArray()) { var_dump($row); } ?>
Taken from here: PHP: SQLite3::query - Manual
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With