mysql - sql Query Not Working in slite + phonegap (count the Number of element in table of given name) -


i counting number of element exit in table not working? try

alert($('.casename_h').val()); 

i getting alert of val ; after code break

var tt  =tx.executesql('select 1 casetable casename ='+"'+ $('.casename_h').val()+'"); 

i call var tt =tx.executesql('select 1 casetable casename ='+ $(".casename_h").val()); alert(tt)

undefined come

try this...

db.transaction(function (tx) {             var casename_h = $('.casename_h').val();             $yoursql = 'select 1 casetable casename = "'+casename_h+'"';             tx.executesql($yoursql, [], function (tx, results) {                 if ( results.rows.length == 0 ) {                     console.log(results.rows);                 }             }); }); 

Comments