Hi you could use a unix timestamp as that would generate a unique code :)
Bind this code to where you want it stored in the database:
<?php echo ((isset($_SERVER["REQUEST_TIME"]))?$_SERVER["REQUEST_TIME"]:""); ?>
and it will store the current datetime as a series of numbers (which is seconds counted from 1970) :)
Chris


