superwormy,
I have made the autoincrement field, just plain varchar(7) labeled 'id'. I have tried selecting the id's from the table and checking the new random number with it, but it just doesnt seem to be working. Here is what i have:
do
{
$fet = "SELECT id from contact_info";
$compare = mysql_query($fet) or die("Could not find an Id: " . mysql_error());
$is_found = mysql_fetch_array($compare, MYSQL_ASSOC);
$id = rand(10,18);
foreach ($is_found as $col_val)
{
if ($id == $col_val)
{
$same = 1;
break;
}
else
$same = 0;
}
}while($same == 1);
//Once this loop exits, it should have a number not already in the
//database stored as $id...and then it should do the insert.
//Although it is doing the insert and there are still duplicate
//numbers coming up...
$insert = "INSERT INTO contact_info(id,
namePre,
nameFirst,
nameMid,
nameLast,
.......