Hello again members of the php Technorati. This time I come seeking you wisdom on a script I am trying to create. Duplicate key entries are rare but do occur and can stop the form process in its tracks. I wrote a simple script to block this from occuring; I am aware of unique keys, but again it will stop the form process. Here is my script:
Code: Select all
$new_ID = rand(0000000000, 9999999999);
$login = mysql_query("SELECT ID FROM login")
or die(mysql_error());
$ID_array = mysql_fetch_array( $login );
If (new_ID == $ID_array['ID']){
$new_ID2 = rand(0000000000, 9999999999);
$new_ID2 = $ID;
}else{
$new_ID = $ID;
}
I would appreciate any input you have.
Thanks in advance,
Batoe