Thanks. I'm laughing and kicking myself because I knew about count(*) and had completely forgotten about it. lol
As far as testing goes, I'm already doing that. Luckily, all the owner wants to use the db for is maintaining membership info and login. Comparing three input fields against one particular id number is very quick so far.
There are actually 2 tables. One for membership data (6 fields that rarely have to be updated other than to deactivate or delete them) and a second for valid membership numbers. The owner sells memberships to groups of people. When he does, he simply enters the range of valid membership numbers.
I have a do while loop set up so it starts at the first number input and runs an insert query for each record until it gets to the end.
$cnum = $_POST[startingnumber];
$qnum = $_POST[quitnumber];
do{
$insnum = "INSERT INTO table (field1, field2) VALUES (".$cnum.", 1)";
$doins = mysql_db_query($dbname, $insnum);
if ($doins != 1){
echo "error msg to user";
echo "<p><b>Error:</b> ".mysql_error();
echo "</p>";
echo "finish error msg to user";
die;
}else{
echo "Card number ".$cnum." added successfully.<br>";
}
$cnum++;
}while($cnum < $qnum);
I ran a test to insert 1 million numbers and it takes quite a bit of time. Any suggestions for that one?