db_query() miltiple statements
#6

Well i think this is not the best idea or maybe very bad idea lol, but this is what i can suggest is:
Add a column named Just_insert to your table. Perform both queries together:
pawn Код:
UPDATE `tableName` SET Just_insert = 0;
INSERT INTO `tableName` (fieldName1,...fieldNameN,Just_insert) VALUES('value1',..'valueN',1)
Note that '1' in end it is to set value of current inserting row to 1 and the above query reset all other valeus to 0.

There can be INSERT query or UPDATE too. Depends since you are asking for latest "Inserted"

laters you can do is:
pawn Код:
SELECT `rowid` from `tableName` WHERE `Just_insert`=1;
it must be handled with care for best results
Reply


Messages In This Thread
sqlite last_insert_id() - by Baltazar - 09.04.2014, 19:29
Re: db_query() miltiple statements - by Niko_boy - 09.04.2014, 20:21
Re: db_query() miltiple statements - by Baltazar - 09.04.2014, 20:30
Re: db_query() miltiple statements - by IstuntmanI - 09.04.2014, 20:37
Re: db_query() miltiple statements - by Baltazar - 09.04.2014, 20:43
Re: db_query() miltiple statements - by Niko_boy - 09.04.2014, 20:56
Re: db_query() miltiple statements - by IstuntmanI - 09.04.2014, 20:59
Re: db_query() miltiple statements - by Niko_boy - 09.04.2014, 21:01
Re: db_query() miltiple statements - by Pottus - 09.04.2014, 21:04
Re: db_query() miltiple statements - by Niko_boy - 09.04.2014, 21:08

Forum Jump:


Users browsing this thread: 1 Guest(s)