[mythtv-users] Recordedid conflict in attempted MythArchive import

Gary Buhrmaster gary.buhrmaster at gmail.com
Wed Jan 4 17:14:45 UTC 2017


On Wed, Jan 4, 2017 at 3:16 PM, Stephen Worthington
<stephen_agent at jsw.gen.nz> wrote:
> .... Then I
> would need to read the new recordedid value back out of that new row

[Generic MySQL answer follows]

That would be, from the same mysql connection, doing
something like:
   select last_insert_id();
The last_insert_id will be the (per connection) last inserted
value for the auto_increment column.

Note that things can get a bit more interesting if you are
not using transactions, your connection can restart without
your knowledge (perhaps due to layering), or you are using
various shared connection techniques.  Exercise of appropriate
caution is left to the implementer based on your needs to
insure data and referential integrity.


More information about the mythtv-users mailing list