Page is a not externally linkable
salewit - 5:57 pm on Apr 19, 2011 (gmt 0)
Yeah, changed LIKE to = and still the same thing. I also even took off the LIMIT 1 and had the same effect. In phpmyadmin I ran: "SELECT * FROM catcount where name = "ri"; and only got that one, so there are no dupes.
I should mention that I just added another check of mysql_affected_rows after every update, and since most of the items haven't changed, I get a 0 next to them, but these 3-4 problem updates ALWAYS have an affected row of 1 even though they're staying at 0. It's almost like it's getting updated to something then back to 0 again, but there's just nothing there to show why that would happen.
Here's the entire code from this section as it actually is. I'm kind of an amateur at this, so I was reluctant to show it.
echo "Checking vendor quantities....<br>";
$selstate = "SELECT vendorid,vendorname FROM vendors";
$resultID = mysql_query($selstate,$linkID);
for ($y=0;$y < mysql_num_rows($resultID);$y++) {
$row = mysql_fetch_assoc($resultID);
echo $row['vendorname'] . "...";
$resultID2 = mysql_query("SELECT count(*) from inventory WHERE status = 1 AND mfg like '".$row[vendorid]."';");
$count = mysql_fetch_row($resultID2);
$j = "UPDATE catcount SET count = " . $count[0] . " WHERE name = '" . $row['vendorid'] . "' LIMIT 1;";
$resultID3 = mysql_query($j);
$jj = mysql_affected_rows();
echo "$count[0] $j $jj <br>";
}
That last troubleshooting echo displays "11 UPDATE catcount SET count = 11 WHERE name = 'ri' LIMIT 1; 1
on the one test problem line. But the quantity in "count" is always 0.