I have an multi-dim. array that contains a set of part numbers in addition to other detail. I then run a query to pull some more data for those part numbers. What I want to do is loop through my query results and find the part number in the original query and push another value onto the first array.
My query works and my loop is moving through it okay. What I can't figure out is how to find the value in the original array.
$queryProduction = "SELECT Production.PartNo AS Part,
SUM(Production.QuantProd) AS Production
FROM Production
WHERE $deptString
AND Production.ProdDate >= '$startDate'
AND Production.ProdDate <= '$endDate'
GROUP BY Part";
$dbResult = mysql_query($queryProduction, $dbConnect);
//$totals is my original array that contains the part number and other info
while($result = mysql_fetch_array($dbResult, MYSQL_ASSOC)) {
If(isset($totals[$row['Part']])) {
echo 'hit'; //this is here just to tell me a value is found
}
}
// if I print_r($result) I can see that this query has good values and I know those values are in the $totals array.