It looks like you're getting the upgrade labels in the MySQL query and not the upgrade numbers like you want. Note that is you previously saved the values by name and then changed it the old values will still be stored until you resave that record.
Anytime a MySQL query isn't working the first thing to do is back up and print out the variables you're passing to it (or the query itself). Try this debug code:
print "<xmp>Product Record: ";
print_r($productsRecord);
print "</xmp>";
or
print "<xmp>a_upgrades: ";
print_r($productsRecord)['a_upgrades'];
print "</xmp>";
Another trick is to add this option which displays the SQL being executed:
'debugSql' => true,
Let me know if that reveals anything useful.
Hope that helps!
Dave Edis - Senior Developer
interactivetools.com