Updating each record in a table column with generated PHP UUID

I have a table called "partners" that contains a very large amount of contact information. After thoroughly cleaning the data from which I got it, I added a UUID column that would ideally like to populate the UUID via PHP $ generateobjectid = (uniqid ('AGF'));

Is there a simple script I could write that would go through the database and enter uniqid for each row at a time?

I would prefer to keep the uniqid generated via PHP so that I can control the prefix between the various entries.

+4
source share
1 answer

why not use mysql UUID () function

UPDATE XXX set FIELD=CONCAT('AGF',UUID()) 
+2
source

All Articles