Re: [sqlite] mysql_insert_id() - how to do multiple inserts safely

2005-03-16 Thread Jay
In my code I do an insert into one table, get the row id of the inserted record, then insert a related record in another table. Do you need to surround your code with a "BEGIN IMMEDIATE" "COMMIT" to ensure there are no other inserts into the first table between the insert and get_inserted_rowid()

Re: [sqlite] mysql_insert_id()

2005-03-16 Thread Clay Dowling
Peter Jay Salzman said: > Do these two functions do the same thing? Are there any surprises or > differences between the two? They do close enough to the same thing that you don't need to worry about it. SQLite ROWIDs can be recycled if you didn't define an autoincrement column and your table h

[sqlite] mysql_insert_id()

2005-03-15 Thread Peter Jay Salzman
Sorry to ask this, but I just want to make sure there aren't any surprises. There's a mysql function: mysql_insert_id( $db_handle ); that returns the ID number of an AUTO_INCREMENT column by the previous INSERT query. I've replaced the call with a sqlite call that sounds like it does the sam