Small. Fast. Reliable.
Choose any three.
*** 6,21 ****
  
  *:In the Zend SQLite tutorial (which is a must-read for all aspiring SQLite users), they suggest that you use the following syntax to open a database:
  
! _:$db = $_SERVER['DOCUMENT_ROOT']."/../database.sdb";{linebreak}
! _:$handle = sqlite_open($db) or die("Could not open database");
  
  _:That makes a lot of sense, and is a simple way to ensure that the database is outside your DocumentRoot. An Sqlite database is a binary file. If you do not want to have people being able to download it, do not put it inside a web accessible directory. (_Suggested by {link: http://php.eckspee.com/ Aaron Wormus}_)
  
  *:If the database has to be stored in one of your web accessible directories just drop the following in a .htaccess in the same directory:
  
! _:<FilesMatch "\.(sqlite|sdb|s3db)$">{linebreak}
! _:Deny from all{linebreak}
! _:</FilesMatch>
  
  _:This way it won't be possible to download the database from a remote computer. (_Suggested by {link: http://php.eckspee.com/ Aaron Wormus}_)
  
--- 6,21 ----
  
  *:In the Zend SQLite tutorial (which is a must-read for all aspiring SQLite users), they suggest that you use the following syntax to open a database:
  
!       $db = $_SERVER['DOCUMENT_ROOT']."/../database.sdb";
!       $handle = sqlite_open($db) or die("Could not open database");
  
  _:That makes a lot of sense, and is a simple way to ensure that the database is outside your DocumentRoot. An Sqlite database is a binary file. If you do not want to have people being able to download it, do not put it inside a web accessible directory. (_Suggested by {link: http://php.eckspee.com/ Aaron Wormus}_)
  
  *:If the database has to be stored in one of your web accessible directories just drop the following in a .htaccess in the same directory:
  
!       <FilesMatch "\.(sqlite|sdb|s3db)$">
!       Deny from all
!       </FilesMatch>
  
  _:This way it won't be possible to download the database from a remote computer. (_Suggested by {link: http://php.eckspee.com/ Aaron Wormus}_)