{"id":2298,"date":"2004-10-29T14:31:44","date_gmt":"2004-10-29T14:31:44","guid":{"rendered":"http:\/\/www.soulhuntre.com\/items\/date\/2004\/10\/29\/uuid-guid-in-native-php\/"},"modified":"2004-10-29T14:31:44","modified_gmt":"2004-10-29T14:31:44","slug":"uuid-guid-in-native-php","status":"publish","type":"post","link":"http:\/\/legacyiamsenseiken.local\/2004\/10\/29\/uuid-guid-in-native-php\/","title":{"rendered":"UUID \/ GUID in native PHP…"},"content":{"rendered":"

In the course of my development efforts it has become fairly clear that I need to make use of a more cross platform and cross server identifier for certain content objects. The common tactic of using a database column that automatically increments has fallen pretty flat for this – it is almost guaranteed to collide if you try and merge tables or data in the future. The code is below the fold!<\/b><\/p>\n

Microsoft databases have the concept of a [[wp;GUID]]  that they implement in a nice simple manner<\/a> and that is supported well in .NET<\/a>.Nothing similar exists in MySQL<\/a> and PHP<\/a> at the moment, though some tantalizing hints existed. Long and short of it, I solved the problem, or at least I have an early attempt at solving the problem. Compare it to the numbers you can get at this online UUID generator<\/a>.<\/p>\n

<\/p>\n

This code is a combination of…<\/p>\n