使用 Titanium appcelerator.如何使用单击按钮激活的 sql 查询对我的数据库进行排序.到目前为止,我的代码是:
Using Titanium appcelerator. How can i sort my database with an sql query which is activated on a button click. my code so far is:
SortButton.addEventListener('click',function(e){
sortList();
});
function sortList()
{
db.execute("SELECT * FROM SavedList ORDER BY SavedListed ASC");
}
你的代码 : db.execute("SELECT * FROM SavedList ORDER BY SavedListed ASC");是正确的.只需在 db.execute 之前打开数据库并在 db.execute 之后关闭它.它会起作用.
Your code : db.execute("SELECT * FROM SavedList ORDER BY SavedListed ASC"); is correct. Just open database before db.execute and close it after db.execute. It will work.
打开数据库:var db = Ti.Database.open('databaseName');
To open database : var db = Ti.Database.open('databaseName');
关闭数据库:db.close();
To close database: db.close();
这篇关于Titanium sqlite ORDER BY 语句的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
在 Apache Spark 中连接到 SQLiteConnect to SQLite in Apache Spark(在 Apache Spark 中连接到 SQLite)
Kafka JDBC 源连接器时间戳模式对 sqlite3 失败Kafka JDBC source connector time stamp mode failing for sqlite3(Kafka JDBC 源连接器时间戳模式对 sqlite3 失败)
Adobe Air:为什么 SQLStatement 的 getResult().data 为空?Adobe Air: why SQLStatement#39;s getResult().data is null?(Adobe Air:为什么 SQLStatement 的 getResult().data 为空?)
SQLite 和 FlexSQLite and Flex(SQLite 和 Flex)
Adobe Air:将 sqlite 的结果 [object Object] 转换为 StriAdobe Air: convert sqlite#39;s result [object Object] to String?(Adobe Air:将 sqlite 的结果 [object Object] 转换为 String?)
sqlite &flex - 如果不存在则插入?sqlite amp; flex - insert into if not exists?(sqlite amp;flex - 如果不存在则插入?)