Guest User

Untitled

a guest
Jul 13th, 2018
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. var database;
  2.  
  3. try{
  4. if(window.openDatabase){
  5. database = openDatabase('WindowsVista', '1.0', 'Windows Vista for iPhone', 200000);
  6. if(!database){
  7. alert('Failed to open database on disk');
  8. }
  9. }
  10. else{
  11. alert('Cannot Open Database');
  12. }
  13. } catch(err){}
  14.  
  15. function newUser(){
  16.  
  17. var username = document.getElementById('username').value;
  18. var password = document.getElementById('password').value;
  19.  
  20. datatabase.transaction(function(data){
  21. data.executeSql('CREATE TABLE IF NOT EXISTS users(id, username, password)');
  22. data.executeSql('INSERT INTO users (username, password) VALUES (' + username + ', ' + password + ')');
  23. });
  24.  
  25. }
Add Comment
Please, Sign In to add comment