PHP Configuration SQLite Database Development Example
Baidu Search Download Sqlitemanager tool
PHP5 already bound SQLite
1. Manually added PHP PDO driver extension support, 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, in C:\Program Files\apache group\php5\ext guarantee has Php_sqlite.dll,php_pdo_sqlite.dll,
Php_pdo.dll Extension Library
3. Restart Apache
4, download Sqlitemanager,create a database, save the name of "Db.sqlite" databases, build tables,
or Sqliteadmin.
5. Link SQLite in PHP
Connecting to a database
The following PHP code shows how to connect to an existing database. If the database does not exist, it will be created (by default in the application directory, for example, in the PHP application directory), and then 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 to create our database test.dbin the current directory. You can change the path as needed. If the database was created successfully, the message shown below is displayed:
Open Database successfully
http://www.bkjia.com/PHPjc/973375.html www.bkjia.com true http://www.bkjia.com/PHPjc/973375.html techarticle PHP Configuration SQLite Database Development example Baidu search download Sqlitemanager tool PHP5 has been bound to SQLite 1, manually added PHP PDO driver extension support, in php.ini add Extension=ph ...