function insertToProject(cast, pName)
{
db.execute('INSERT INTO project (cd, pn) VALUES (?,?)', cast, pName);
var x = last_insert_rowid();
return x;
}
我一直在使用钛appcelerator中的javascript尝试这个.谁能告诉我我做错了什么?
解决方法:
为此,您可以使用数据库对象的lastInsertRowId属性.
您可以使用:
var x = db.lastInsertRowId;
lastInsertRowId
lastInsertRowId: NumberThe identifier of the last populated row
请查看此链接了解更多详情:Titanium.Database.DB
【说明】:本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!