I'm porting over a small php app to use sqlite, and this is the first time that I use sqlite with php and its been a while since i last coded something with php(it was php4 by the time). The trouble i'm having right now is that apparently with sqlite you need to call the sqlite3 object several times since it apparently doesnt establish a permanent connection with the database, so my code right now is filled with
$db = new SQLite3('test.db');
in every single function in the code. is this efficient? is there a better and cleaner way of doing this?
the other issue that i'm having is if i use sqlite inside say include/functions.php it tries to look for test.db inside this include/ dir when it should be using the app root. how could i fix this efficiently?