Demaestro - 5:18 pm on Apr 19, 2011 (gmt 0)
I wonder if because you are using like but haven't included any wildcard chars as a reason.
Some rows may = ri some may need the a wildcard char to match which MAY explain why it works sometimes.
$j = "UPDATE catcount SET count = " . $count . " WHERE name LIKE '%" . $row['vendorid'] . "%' LIMIT 1;";
Without seeing the data I am not sure if this is the problem though