This topic is locked
[SOLVED]

 Primary Key Help

4/25/2012 7:28:00 AM
PHPRunner General questions
C
ckapote author

Hi , any ideas when I add a new record I need my primary key ( Varchar type) to add an

automatic 26 length letters and letters randomly selected plus date/time in that way that it will be almost impossible to re created
i.e. 2wd3hr5j6k2l3mbr8osqlc9mdf250420121403
Please help
I DID THAT BUT CANNOT make it as above
for($i=0; $i<7; $i++){

$random_string .= chr(rand(0,25)+65);

}

echo $random_string;

C
cgphp 4/29/2012
$random_string = uniqid("", TRUE) . date("dmYhis");
C
ckapote author 5/16/2012

thank you very much