Popular recipes tagged "activerecord"http://code.activestate.com/recipes/tags/activerecord/2011-02-24T21:43:55-08:00ActiveState Code RecipesYouTube-like primary key generation (PHP)
2011-02-24T21:43:55-08:00Slava Yansonhttp://code.activestate.com/recipes/users/4176967/http://code.activestate.com/recipes/577571-youtube-like-primary-key-generation/
<p style="color: grey">
PHP
recipe 577571
by <a href="/recipes/users/4176967/">Slava Yanson</a>
(<a href="/recipes/tags/activerecord/">activerecord</a>, <a href="/recipes/tags/database/">database</a>, <a href="/recipes/tags/php/">php</a>, <a href="/recipes/tags/unique/">unique</a>).
Revision 4.
</p>
<p>If you have more then 1 primary database servers - you have probably experienced the pain of primary key overlapping... Here is a super simple solution that will generate a hash of random letters and numbers.</p>
<p>Included is a sample ActiveRecord class (MyTable.php).</p>