Persistance sometimes pays off, sortta.
This at least will update the table:
<?php
$host="localhost";
$user="root";
$password="g1G3m#1989";
$Dbname = "CallsToDispatch";
$cxn = mysql_connect($host,$user,$password)
or die (mysql_error() . "couldn’t connect to server");
mysql_select_db($Dbname, $cxn)
or die(mysql_error() . "couldn't select database");
$Quest = "SELECT * FROM CallCount";
$result = mysql_query($Quest, $cxn)
or die ('Santa Claus is watching you' . mysql_error());
while ($row = mysql_fetch_array($result))
{
$TechNum = $row['TechNum'];
$CellNum = $row['CellNum'];
$i++;
echo $i . ' ' . $TechNum . '<br />';
$result1 = mysql_query("UPDATE `CallCount` SET `IdNum` = '$i'")
or die ("cannot update ". $TechNum);
}
?>
Now the question is, How do I read from one row, write to that row, and then move on to the next row. The way the script is set up now, the update sets IdNum = $i, and doesn't advance to the following record. So, the script writes $i to all 52,215 rows, advances to the next number, and writes that on all 57,215 records, and on and on, and on.