10.09.2010, 04:42
Has anyone created a function similar to mysqls mysql_insert_id(); function for SQLite usage?
Because right now what I can do is limited because I need it to return the ID of the auto-increment named id.
I would assume that the easiest way would be to loop through all id's and find the highest, but then again if by some chance another query was executed before the loop had finished then it would return an ID of another item, or is there another way to do it?
Pretty confused about this because I'm not that used to mysql never mind sqlite although I've had no problems as of yet.
Any ideas?
Because right now what I can do is limited because I need it to return the ID of the auto-increment named id.
I would assume that the easiest way would be to loop through all id's and find the highest, but then again if by some chance another query was executed before the loop had finished then it would return an ID of another item, or is there another way to do it?
Pretty confused about this because I'm not that used to mysql never mind sqlite although I've had no problems as of yet.
Any ideas?