I am able to clone a row in my table with the following code:
$uuid = 'blahblah';
INSERT INTO events (title, subtitle) SELECT title, subtitle FROM events WHERE uuid = '$uuid'
However, I want to generate a new unique ID for the newly cloned row. The name of this table column is “uuid” How do I insert a new unique ID during the cloning process? I have an auto index columnt of type INT but I also have a unique ID column of type VARCHAR for each row (mixed alpha numeric).
Thanks in advance.
I found the answer here – PHP MySQL Copy a row within the same table… with a Primary and Unique key
Basically, select everything except the ID and as long as the primary key is set to auto increment – shouldn’t be a problem.