Here is one of the simplest routines I have written--right? No, wrong. The script takes a table, folds, spindles, and mutilates it, and writes the data back to the table. Here's the code:
$Quest = "SELECT * FROM TOAWorkorders";$FindTechResult = mysql_query($Quest, $cxn) or die ('The easter bunny is watching you' . mysql_error());while ($row = mysql_fetch_array($FindTechResult)){ $IdNum = $row['IdNum']; $BBT = $row['BBT']; $BBTArray = explode("-", $BBT); $TechNum = $BBTArray["0"]; $Title = $BBTArray["2"]; $Name = explode(" ", $BBTArray['1']); $FirstName = $Name["0"]; $LastName = $Name["1"]; echo $TechNum . ' !! ' . $FirstName . ' !! ' . $LastName . ' !! ' . $Title . '<br>'; $Quest = "UPDATE TOAWorkorders SET TechNum = '$TechNum', FirstName = '$FirstName', LastName = '$LastName', Title = '$Title' WHERE IdNum = '$IdNum'";$result = mysql_query($Quest, $cxn) or die(mysql_error()); }
The problem with the script is the `UPDATE` statement. The field is processed correctly, but the update only updates 2/3 of the table, leaving 33k of rows untouched. Any ideas??