Hi Peter,
I have used this in the past
$QueryStr = "select lpad(count(*)+1,5,'0') THE_ID from manager";
$Result = MySQL_Query($QueryStr);
$TheID = MySQL_Result($Result,0,0);
$TheName = StrToUpper(SubStr($firstname.$surname,0,5));
$TheNewID = $TheName.$TheID;
$TheNewID = Str_Replace(" ","S",$TheNewID);
This first generates a number based on max records in table and left pads it with 0, like 00012.
Then concatenates the manager first and last names and takes the first 5 characters, like
BOB M
joins the two together BOB M00012, then replaces any spaces with an S, so I end up with BOBSM00012.
This is then stored in a varchar(10) field.
I know there is a slim chance that the same key could be generated again, so it wouldn't meet your 100% uniqueness, it is probably about 99%. ;-)
My reason for using this was not because I thought I might go over the max value for an auto_increment field, but to protect my site from anyone guessing the key that may be passed as POST variables.
Hope this helps
Mike