angularjs - How to insert username password into sqlite on login If not exists? -
i want insert username , password sqlite on login if not exists, because want keep registration , login db separately.
how can check , insert?
you can update table schema following , push insert query.
create table tbllogin (id integer primary key autoincrement, username varchar, password varchar, unique(username) on conflict ignore)
on conflict ignore
ignore insert query if username still exist in table.
just make clear, last_insert_rowid()
still return valid id if insert query ignored , database connection same invoked function. reference here.
hope helps.
Comments
Post a Comment