Return value entered after performing INSERT

0

I have a following table:

CREATE TABLE tblUser (
    id INTEGER PRIMARY KEY AUTOINCREMENT,
    uuid VARCHAR(24) NULL,
    name VARCHAR(256) NULL
}

I'm inserting a uuid random so that it's a unique identifier directly inside my database using:

select substring(MD5(RAND()) FROM 1 FOR 24

This query on top gives me a value like this: c4b912f99fc0c2e82526043c

In PHP I can return the last id entered in the database using mysql_insert_id() , but I would like my INSERT to return the value of UUID without having to create a SELECT . Is there any way to do this?

    
asked by anonymous 10.12.2016 / 14:40

1 answer

1

You can not figure out what was entered in INSERT other than the last ID , you have to SELECT itself.

    
10.12.2016 / 15:51