Advertisement
pasteguy10923

unkhown

Oct 8th, 2017
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. <?php
  2. // be aware of too big files
  3. // they will cause a memory error
  4. // lookin forward to handle this
  5. include('securesqlite.class.php');
  6.  
  7. /**
  8. * connect to encrypted SQLite db
  9. */
  10. try {
  11. // if there is no database with this name it will be created
  12. // it will create a database like yourDatabase.encrypted.db
  13. // and it will use a decrypted database like yourDatabase.db
  14. $db = new secureSQLite('yourDatabase.db','YourKeyForEn-AndDecryption');
  15. } catch(Exception $e) {
  16. die(dPrint($e->getMessage()));
  17. }
  18.  
  19. // create a table
  20. $db->query("CREATE TABLE IF NOT EXISTS `test_table` (`name` VARCHAR( 20 ) NOT NULL)");
  21.  
  22. // close and save encrypted db
  23. // if you close db without parameter "true" it won't save changes
  24. // YOU SHOULD ALWAYS CLOSE THE CONNECTION TO REMOVE THE DECRYPTED DATABASE
  25. $db->close(true);
  26. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement