Introduction to SQLite |
 |
2025-02-23 |
 |
 |

6 |
 |
 |
As with any database system the first thing you must do is open a database. Since SQLite is based on files
opening a database differs very little from opening a regular file.
<?php
$db = sqlite_open("./ip.db", 0666, $error)
or die("Failed to connect because: ".$error);
?>
Notes
- • If a database does not a exist a new one will be created.
- • Database path will be checked against safe_mode & open_basedir.
- • If database path is :memory: will create a memory only database.
- • In the future the 2nd argument will allow opening the database in read-only mode.