dimanche 1 novembre 2015

selecting record from sqlite

I'm trying to fetch records from a sqlite table by the below function:

factory.getUserInfo = function () {
        var defferd = $q.defer();


        db.transaction(getUserInformation, errorDB, successDB);

        function errorDB(err) {
            defferd.reject(err);
        }

        function successDB(result) {
            defferd.resolve(result);
        }

        function getUserInformation(tx) {
            tx.executeSql('SELECT * FROM USERINFO ', [], resultSuccess , errorSuccess)


        }

        function errorSuccess(err) {
            defferd.reject(err);
        }

        function resultSuccess(result) {
            console.log("12121",result);
            defferd.resolve(result);
        }

        return defferd.promise;
    };

but the problem is here nothing logs. no error no results. I'm stuck here!!!

Aucun commentaire:

Enregistrer un commentaire