It is necessary to check: is there a user in the WebSQL database with a login and password entered? The problem is that the data that is in the database is not at the request. How to fix? Maybe something is wrong? I attach the code below:
(function () { var submitButton = document.getElementById("submitButton"); submitButton.addEventListener('click', submitButtonHandler); function submitButtonHandler(event) { event.preventDefault(); var inputLogin = document.getElementById("login"); var inputPassword = document.getElementById("password"); db = openDatabase("usersDB", "0.1", "A list of users", 100); if(!db) {alert("Failed to connect to database."); } db.transaction(function (tx) { tx.executeSql("SELECT COUNT(*) FROM usersDB", [], function (result) {alert("aaaa")}, function (tx, errror) {alert("qqqq")}); }) } })();
SELECT COUNT(*) FROM usersDB? Do you have the database name coincides with the table, there is no typo? What do you get as a result? What error code or message? YouinputLoginandinputPasswordnot used in the query, by the way. The query is a simple selection of the number of entries in theusersDBtable. - Denis BubnovusersDBtable isusersDB- Mike