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 ZIP VFS to compress a database?
- How do I use the SQLite sequence feature?
- How can SQLite and ZFS be used together for software development?
- How do I use SQLite to zip a file?
- How do I call sqlitepcl.raw.setprovider() when using SQLite?
- How do I use SQLite to retrieve data from a specific year?
- How do I use SQLite with Visual Studio?
- How do I use regular expressions to query a SQLite database?
- How do I list all tables in a SQLite database?
See more codes...