Yeah, I just found it - but I have another issue
Here's the corrected code by the way:
<?php
require('qs_connection.php');
require('qs_functions.php');
require('../config.php');
## Performing a query to find all the ingredients of the ZG loot system, including the
## event days where the names match up for both tables
$query = "
SELECT mc_drop_garr.item item, COUNT( fab_mc.epics ) epics, mc_drop_garr.`drop` drops
FROM `fab_mc` , `mc_drop_garr`
WHERE fab_mc.epics = mc_drop_garr.item
GROUP BY mc_drop_garr.item";
$result = mysql_query($query) or die(mysql_error());
$num=mysql_numrows($result);
$i=0;
while ($i < $num)
{
$drops=mysql_result($result,$i,"epics");
$sql = "UPDATE `mc_drop_garr` SET `drop`= '$drops'";
if ($sql_debug_mode==1) { echo "<BR>SQL: $sql<BR>"; }
$result = mysql_query($sql);
if ($result == 1) {
die ('<center>Garr dropped totals have been updated.</center>');
} else {
echo "Error with SQL and updating..";
}
}
?>
It's updating all of the fields with "2" instead of updating them with the correct numbers. The query I uses is sorting the numbers correctly, but maybe I need to load them in an array and then update properly.
Any help here?