so if i do this and there is already an entry in the database that has the userID set as '1111'
it shouldnt insert?
do
{
$userID = '1111';
/*for ($count = 0; $count < 32; $count++)
{
$char = 0;
switch (rand(0, 2))
{
case 0:
$char = rand(65, 90);
break;
case 1:
$char = rand(97, 122);
break;
case 2:
$char = rand(48, 57);
break;
}
$userID .= chr($char);
}*/
$sql = sprintf("INSERT INTO user (id) VALUES (%d)", $userID);
}
while (!mysql_query($sql) && mysql_errno() == 1062);