hi , i am using SQLite manger addon to create my SQLite db , it works fine without problems , but the problem if i export the db from it as .sql and install the app it gives no such table error
after exporting i think something missing there , where the type of title and link ? , i defined them as int , i tried to write it and save the db file but still same error
i tried to use phpMyAdmin to create db and export it as: .sql and this is the content of it :
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; CREATE TABLE IF NOT EXISTS `archive` ( `title` int(11) NOT NULL, `link` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `archive` -- INSERT INTO `archive` (`title`, `link`) VALUES (111, 111), (222, 222); /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;and still the same error no such table
this is the install code in the app :
works fine:
function sqliteDB() { var db = Ti.Database.install('/Test1.sqlite', 'test1'); var a = db.execute('SELECT title FROM archive'); var counter=0 while (a.isValidRow()) { label1.text+=a.fieldByName('title')+'\n'; counter++; a.next(); } a.close(); db.close(); }
not work :
function sqlDB() { var db = Ti.Database.install('/Test1.sql', 'Test1'); var a = db.execute('SELECT title FROM archive'); var counter=0 while (a.isValidRow()) { label1.text+=a.fieldByName('title')+'\n'; counter++; a.next(); } a.close(); db.close(); }
i always delete the app from device and re-install after any change in the db