1
var insertReq:SQLStatement = new SQLStatement();
insertReq.addEventListener(SQLErrorEvent.ERROR, dbErrorHandler);
insertReq.sqlConnection = conn;
insertReq.text = "INSERT INTO table1 (inputTime) VALUES (DATETIME('now'))";
insertReq.execute();
insertReq.text = "SELECT last_insert_rowid() as ID";
insertReq.execute();
var lastInsertId:int = insertReq.getResult().data[0].id;
trace(lastInsertId);
我做了一個本地數據庫和我試圖插入一些數據,但 我得到lastInsertId
零?我把事情搞亂了!?柔性本地數據庫lastInsertId = 0
通過替換解決 變種lastInsertId:INT = insertReq.getResult()的數據[0] .ID; 與 var lastInsertId:int = parseInt(insertReq.getResult()。data [0] .id); – vicx 2012-07-07 20:57:29