SQLite is a small and lightweight database. the supported SQL statements are not inferior to those of other databases. the supported programming languages include Tcl, C #, PHP, and Java, now let's learn how to use SQLite in PHP. 1. how to create a folder: SQ... SQLite is a small and lightweight database. the supported SQL statements are not inferior to those of other databases. the supported programming languages include Tcl, C #, PHP, and Java, now let's learn how to use SQLite in PHP.
1. how to create a folder:
SQLite will automatically determine whether the folder exists. if it does not exist, it will be created.
Try {$ db_conn = new PDO ('sqlite: mydb. sqlite ');} catch (PDOException $ e) {echo 'error';} $ stmt = "create table mytable (id, user )"; $ db_conn-> exec ($ stmt );
II. how to write files:
The usage is similar to that of MySQL.
$ Stmt = "insert into mytable (id, user) VALUES ('1', 'AAA')"; $ db_conn-> exec ($ stmt );
III. how to use data:
The usage is similar to that of MySQL.
$ Something = $ db_conn-> prepare ("SELECT id, user FROM mytable"); $ Something-> execute (); while ($ row = $ Something-> fetch (PDO:: FETCH_ASSOC) {echo $ row ['id']. ':'. $ row ['user']. '';}
Address:
Reprinted at will, but please attach the article address :-)