How it's the ID from clients, contacts,etc in the database

Hey,

I would like to know how the id’s from the database are made, with some algorithm?
I want to know that, so I can insert clients via php with inserts.

Thanks.

ID are UUID read it here https://en.wikipedia.org/wiki/Universally_unique_identifier

to insert one just make it like this

INSERT INTO `accounts` (`id`, `name`) VALUES (UUID(), 'Your_Company');

where the UUID() is generated automatically

best regards

1 Like

Hey thanks for the answer, it works!

I also have another question, this also works for related fields?, i.e. emails_addr_bean_rel.

Thanks again!

A bit more information about UUID generation… Have a look at file include/HTTP_WebDAV_Server/Server.php and search for “function _new_uuid()”
there you will find how the uuid is generated. :slight_smile:

1 Like