title: user login using cordova
body: <p>i'm gettin sql processing error sql:underfined here.Here i'm check whether the login form matched with the database called student and if there is a matched then an alert popup with welcome message and transfer to the next page.How do i fix the code?</p>
  
  <pre><code>document.addEventListener("deviceready", onDeviceReady, false);
  
              var db;
  
  
              function onDeviceReady() {
  
                  db = window.openDatabase("Database", "1.0", "Student",2*1024*1024);
                  db.transaction(createDB, errorCB, successCB);
  
              }
   function loginForm(){
                db.transaction(checkDB, errorCB);
                $.mobile.changePage("#page5",{reverse:false,transition:"slide"});
                return false;
             }
  
        function checkDB(tx){
        var _matric=$("[name='matric']").val();
        var _password=$("[name='password']").val();
        var sql ='select * from STUDENT where matric='+_matric+' and password='+_password+'';
        tx.executeSql(sql,[],successLoginDB,errorCB);
        }
  
        function successLoginDB(tx,results){
        var len = results.rows.length;
        var _name =$("[name='name']").val();
        if (len==1) {alert("Welcome "+_name);}
        }
  </code></pre>