BTW, just tried changing the data type to INT, and it still did it, then changed it to VARCHAR(100) and changed the update to: UPDATE `catcount` SET `itemcount` = '" . $count . "' WHERE `name` = '" . $row['vendorid'] . "'; and it still left a zero instead of the correct number. I also did a table check and repair, and both were ok. I'm stumped! If ALL the records weren't updating properly, that would be one thing. But just a seemingly arbitrary handful? It's bizarre.