Today we are studying SQLite and PdO MySQL.
Let's talk about two things in our own words:
SQLite is an unsystematic database storage method, and its storage format is one. DB suffix files are stored in the current directory in PHP. It seems that the user name and password are not used, and the security is low, but it is more convenient. Some built-in system functions in PhP5 start with SQLite.
The full name of PDO is PHP Data Object. Is it a system object of PHP? The operation starts with a class. Similar to MySQL.
Here is an excerpt from the function:
1. SQLite:
$ Db = sqlite_open ("php100.db"); <br/> $ SQL = "select * from test"; <br/> $ result = sqlite_query ($ db, $ SQL ); <br/> $ ROW = sqlite_fetch_array ($ result); <br/> print_r ($ row );
2. pdo mysql:
$ Db = new PDO ("MYSQL: host = localhost; dbname = student", 'root ',''); <br/> $ rs = $ db-> query ("select * From testmem"); <br/> while ($ ROW = $ RS-> fetch ()) {<br/> print_r ($ row); <br/> echo "<HR size = 1>"; <br/>}