sqliteHow to configure SQLite with XAMPP on Windows?
- Install XAMPP from Apache Friends website.
- Download SQLite from SQLite Download Page.
- Extract the downloaded file in
C:\xampp\php\ext
directory. - Open
php.ini
file inC:\xampp\php
directory and add the following line at the end of the fileextension=php_sqlite3.dll
- Restart XAMPP.
- Test the installation by running the following code in
C:\xampp\htdocs
<?php
$db = new SQLite3('test.db');
$db->exec('CREATE TABLE foo (bar STRING)');
$db->exec("INSERT INTO foo (bar) VALUES ('This is a test')");
$result = $db->query('SELECT bar FROM foo');
var_dump($result->fetchArray());
?>
Output example
array(1) {
[0]=>
string(14) "This is a test"
}
- Finally, you can access the SQLite database through the XAMPP server.
More of Sqlite
- How do I use the SQLite YEAR function?
- How can I use SQLite with Xamarin Forms?
- How can I use SQLite with Xamarin?
- How do I use the SQLite VARCHAR data type?
- How can I use SQLite with WebAssembly?
- How do I show the databases in SQLite?
- How do I use UUIDs in SQLite?
- How do I use SQLite with Zephyr?
- How can I use SQLite to query for records between two specific dates?
See more codes...