Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70435

executeSql doesn't work

$
0
0

@Harryyy wrote:

Hello,

I tried to select items in my database but my code do nothings, and my alerts are not triggers :

	// Récupére les représentations photo d'un symbole
	private getRepresentationsPhotoOfSymbole(idSymbole){
        return new Promise( (resolve, reject) => {
        	this.db.executeSql('select * from representationPhoto where idSymbole='+idSymbole+'',null).then( data => {
                alert("THIS ALERT DOESN'T TRIGGER");
        		// On convertie le resultat en array
        		var representationPhotoArray= [];
                if(data.rows.length > 0){
                    for(var i = 0; i< data.rows.length; i++){
                        representationPhotoArray.push(data.rows.item(i));
                    }
                }else{
                	console.log("attention data.rows.length = 0 ");
				}
                // On retourne cette array contenant les reprensentations photo
        		resolve(representationPhotoArray);
			})
				.catch(err =>{
                    alert("THIS ALERT DOESN'T TRIGGER EITHER");
                    reject(null);
				});
        });
	}

I don’t know why the “then” and the “catch” both doesn’t work, can you help me please ?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70435

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>