mardi 13 octobre 2015

Listing all table names from a phonegap db

I am new to the Phonegap development. using Phonegap db for an app creation. I have a db called 'test' and i am creating multiple tables using following code.

var createTableQuery = "CREATE TABLE IF NOT EXISTS "+tableName+"(id VARCHAR, Description VARCHAR, Amount VARCHAR, Dateandtime VARCHAR)";    
tx.executeSql(createTableQuery);

now i want to display the all the table names which created in the test db.

i used the following code to display the table names. but nothing happens.

selectQuery = 'SELECT table_name FROM test';
tx.executeSql(selectQuery,[], gotLog ,errorHandler);

Please advice me to go further. Thanks in advance.

Aucun commentaire:

Enregistrer un commentaire