I am very junior working with PHP, and until now, I have been working with mysqli. I have been told to learn PHP in general, so, I found a tutorial for doing CRUD using SQLite PDO.
I literally just started it with the first video, and I am confused already... I have done research on internet and php documentation, but I can't find the answer I am looking for.
$db = new PDO("sqlite:".__DIR__."/the_database.db");
This is the line to create the database; my question:
Does the database needs to be in the root directory of my project? I am finding so many different options on internet..... almost all of them the database doesn't even finish with .db but with .sqlite .... but I hope this part will be explained later on the tutorial.
My big question is, why am I adding ".__DIR.__"
, is it because it HAS TO BE on the root folder? Or could I just place it as $db = new PDO("sqlite:"the_database.db");
? I have been trying to answer the question myself, trying to find how to "SHOW DATABASES" or something like that but this SQLite seems so complex....
Thank you