I have a database in MySQL and each table has its primary key that was inserted using the following structure: "INSERT INTO TABLA VALUES (UUID(),CAMPO1,CAMPO2)"
, until then everything is perfect.
My question is this, how can I get the last insertion of this table, which unfortunately when doing this type of insertion there is no correlative order to use last_insert_id()
, among others. It should be noted that this is the query I must perform (since it is not necessary to obtain the last record immediately after inserting it): SELECT ultimo_registro FROM tabla
PS: we must bear in mind that the tables can not be modified, the db can be touched but not modified, and if they are different pages, in one where the "new SME" is registered, and in the other where is the registration of the product offered by that SME, to make that registration I need the id of that SME
I await answers, thank you very much.