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 to be a unique identifier directly within my database using:
select substring(MD5(RAND()) FROM 1 FOR 24
This query just above me returns a value like this: c4b912f99fc0c2e82526043c
In PHP I can return the last id
inserted into the bank using mysql_insert_id()
, but I would like in my INSERT
return me the value ofUUID
without having to create a SELECT
. Is there any way to do that?
Do you think you can accept the answer? Or do you need something else?
– Maniero
Hi @bigown, only your second sentence of the answer answered my question, but without any reference. But of course I know you’re quite a reference (I’m not sucking up - I think). The first sentence I will take as a suggestion, important, but not as an answer. I realized that in fact my attempt to generate a UUID - which is not uuid - is somewhat flawed, because, as they said and another question: "lightning always falls in the same place when it has to fall". Thank you for the teaching, for me and for many people here. I have a lot to learn and I will continue to persist in this.
– viana