Example, php reads sqlite data.
-
-
//Open sqlite database - //$db = @sqlite_open("MM.sqlite", 0666, $error); // Not supported
- //$ db = new PDO('sqlite:MM.sqlite');
- //Exception handling
- if (!$db) die("Connection Sqlite failed.n");
//Add A database called foo
- //@sqlite_query($db, "CREATE TABLE foo (bar varchar(10))");
- //Insert a record
- //@sqlite_query($db, "INSERT INTO foo VALUES (' fnord')");
//Retrieve all records
- $result = $db->query('select BottleEncryptUsrName from BottleTable4');
//Print the obtained results
- foreach($result as $row){
- echo $row[0];
- echo "
";
- }
- ?>
-
Copy code
|