SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    May 2013
    Posts
    192
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    web sql - only database i can see? not see tables not see entries...

    i USED THIS BUT IN Chrome or Safari web inspector tools only database i can see? not see tables not see entries...

    Code:
    $(document).bind("mobileinit", function(){
    	alert("entered");
        $.mobile.notesdb = openDatabase('polisapp', '1.0', 'Polis Travel Entries', 1*1024*1024);
        $.mobile.notesdb.transaction(function (t) {
    		
    t.executeSql('CREATE TABLE IF NOT EXISTS buinessTable (id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL, catCode INTEGER NOT NULL, description TEXT, address TEXT, tel INTEGER, telMob INTEGER, email TEXT, url TEXT, long REAL, lat REAL, urlImg1 TEXT, urlImg2 TEXT, field1 TEXT, field2 INTEGER, field3 REAL);');
    
    t.executeSql("INSERT INTO buinessTable (name, catCode, description, address, tel, telMob, email, url, long, lat, urlImg1, urlImg2, field1, field2, field3) VALUES ('Anassa Hotel', 14,'5-star Hotel','40, Regenas Road, 8852 Neo Chorio, Polis',26888000, 26322900,'anassa@thanoshotels.com','http://www.anassa.com.cy', 123.5667, 123.788, '', '', '', , );");
    t.executeSql("INSERT INTO buinessTable (name, catCode, description, address, tel, telMob, email, url, long, lat, urlImg1, urlImg2, field1, field2, field3) VALUES ('Natura Hotel', 14,'3-star Hotel','Papanikopoulos Ave, P.O.Box 66162, Polis 8831', 26323111, 26322822, 'natura@cytanet.com.cy', 'http://www.natura.com.cy', 13.5667, 13.788, '', '', '', , );");
    t.executeSql("INSERT INTO buinessTable (name, catCode, description, address, tel, telMob, email, url, long, lat, urlImg1, urlImg2, field1, field2, field3) VALUES ('Marion Hotel', 14,'3-star Hotel','9 Mariou Str, Polis Chrysochous', 26321459, 26322124, 'marionhotel@cytanet.com.cy', 'http://www.marionhotel.com.cy', 93.5667, 43.788, '', '', '', , );");
    
    t.executeSql('CREATE TABLE IF NOT EXISTS catTable (id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, catCode INTEGER, catName TEXT);');	
    	
    t.executeSql("INSERT INTO catTable (catCode, catName) VALUES (10, 'Restaurant');");
    t.executeSql("INSERT INTO catTable (catCode, catName) VALUES (11, 'Bar');");
    t.executeSql("INSERT INTO catTable (catCode, catName) VALUES (12, 'Cafe');");
    t.executeSql("INSERT INTO catTable (catCode, catName) VALUES (13, 'Petrol Station');");
    t.executeSql("INSERT INTO catTable (catCode, catName) VALUES (14, 'Hotels');");
    t.executeSql("INSERT INTO catTable (catCode, catName) VALUES (15, 'Apts');");
        
    	});
    });

  2. #2
    SitePoint Zealot
    Join Date
    May 2013
    Posts
    192
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    is this for only one statement... then how massively execute statements or sql file in web sql?

    Code:
         $.mobile.notesdb.transaction(function (t) {
    		
    t.executeSql("CREATE TABLE IF NOT EXISTS buinessTable (id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL, catCode INTEGER NOT NULL, description TEXT, address TEXT, tel INTEGER, telMob INTEGER, email TEXT, url TEXT, long REAL, lat REAL, urlImg1 TEXT, urlImg2 TEXT, field1 TEXT, field2 INTEGER, field3 REAL);");	
    		});


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •