开发者

How to generate sequential GUIDs?

开发者 https://www.devze.com 2022-12-14 22:41 出处:网络
Are there PHP l开发者_运维知识库ibraries to generate sequential GUIDs for usage in a MySQL database?If you mean uuids based on a common prefix, such as MAC and time, have a look at uniqid. Here you ca

Are there PHP l开发者_运维知识库ibraries to generate sequential GUIDs for usage in a MySQL database?


If you mean uuids based on a common prefix, such as MAC and time, have a look at uniqid. Here you can also find some code for RFC 4211 compliant UUIDS. If you want to be on the safe side, use this wrapper to libuuid: pecl uuid. Haven't tested it though, YMMV.


I believe what is being asked for is, does MySQL have support for Sequential Id's the way that SQL Server does?

http://blogs.msdn.com/b/sqlserverfaq/archive/2010/05/27/guid-vs-int-debate.aspx

Now before everyone asks why use GUIDS, GUIDS will allow one to move/merge data between tables and databases.

0

精彩评论

暂无评论...
验证码 换一张
取 消