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?