Php configuration sqlite Database Development Instance
Download SqLiteManager from Baidu search
PHP5 has been bound to sqlite
1. Manually added support for php pdo Driver Extensions, added in PHP. ini
Extension = php_pdo.dll
Extension = php_pdo_sqlite.dll
Extension = php_sqlite.dll
Extension_dir = "C: \ Program Files \ Apache Group \ php5 \ ext"
2. Ensure that php_sqlite.dll and php_pdo_sqlite.dll are available in C: \ Program Files \ Apache Group \ php5 \ ext,
Php_pdo.dll extension Library
3. Restart apache
4. Download SQLitemanager and create a database, save the database named "db. sqlite", and create a table,
Or sqliteadmin
5. Link SQLite in PHP
Connect to database
The following PHP code shows how to connect to an existing database. If the database does not exist, it will be created (created in the application directory by default, for example, under the php application directory), and a database object will be returned.
open('test.db'); } } $db = new MyDB(); if(!$db){ echo $db->lastErrorMsg(); } else { echo "Opened database successfully\n"; }?>
Now, let's run the above program and create our database in the current directoryTest. db. You can change the path as needed. If the database is successfully created, the following message is displayed:
Open database successfully