Search the Community
Showing results for tags 'sqlite'.
-
Howdy, So I am creating a website with SQLite and this time I decided to follow the rule of putting the SQLite DB outside of the document root. However, the admin would need to admin, basically, the DB, so I have two choices: a) Put PhpLiteAdmin (The SQLite DB manager like PHPmyAdmin is for MySQL) in the document root while giving it a path to the actually DB that is outside of the document root; b) Set a subdomain to a directory outside of the document root of course and put both PhpLiteAdmin and the SQLite DB there and the admin would access it like this - db.Awesome-Website.com; Which one of those two options are safer? Thank you very much!
-
Hello! I found out that some 'SELECT' SQL queries are very slow with pdo_sqlite (PHP 5.3 or PHP 5.4). The same query entered in the sqlite3 binary is way faster. Here is my project : http://we.tl/59fGSVnAXh (password : "sqlite-php") - bench.php - chaines_centre.db - inc_func.php - info_job.php The info_job.php page performs 5 'SELECT' queries in 10 seconds with my Apache server. A same query is perform in less than 0.2 seconds in the sqlite3 binary (so theoretically 1 second for the whole page). I tried to modify the query a bit, and the results are strange : Benchmark (bench.php) on the « $bdd->query(...); » instruction : Query 2 : select DateMonteeAuPlan, Debut, Fin, Statut from ReportJobs where NomJob = 'NSAVBASE' and NomChaine like 'DCLC257%' limit 20; => 0.00099992752075195 seconde(s) Query 3 : select DateMonteeAuPlan, Debut, Fin, Statut from ReportJobs where NomJob = 'NSAVBASE' and NomChaine = 'DCLC25736' order by DateMonteeAuPlan DESC limit 20; => 0 seconde(s) Query 1 : select DateMonteeAuPlan, Debut, Fin, Statut from ReportJobs where NomJob = 'NSAVBASE' and NomChaine like 'DCLC257%' order by DateMonteeAuPlan DESC limit 20; => 1.8629999160767 seconde(s) Why is there so much differences between two query quasi-identical? How can I improve this situation to get results as fast as the sqlite3 binary? Thanks if you took the time to look out my project files.