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

SQLite two tables fails (property undefined)

$
0
0

@barreola wrote:

I’m working with SQLite, but when I try to open a page, the next error is shown.

But the database is actually open
image

constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen, private lookandfeel: LookandfeelProvider, public db: DatabaseProvider, public storage: Storage) {
    this.lookandfeel.getActiveTheme().subscribe(val => this.selectedTheme = val);

    platform.ready().then(() => {

      splashScreen.hide();
      statusBar.styleLightContent();

      this.db.openDb()
        .then(() => this.db.createTable())
        .then(() => this.db.createTableProfile())
    });
  }

Above is the code when I open the database once the platform is ready.
I saw that only the first sentence appears to work the this.db.createTable() but the next one is just ignored I guess. This is my method.

public createTableProfile() {
    return this.db.executeSql("CREATE TABLE IF NOT EXISTS profile(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT, lastname TEXT, phoneNumber INTEGER, address TEXT)", {});
  }

Why it keeps saying thats name is undefined?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70434

Trending Articles



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