Obviously I don't know what I'm doing, our developer left, and I'm in a real bind. Many thanks in advance for your patience and assistance.
The script below pulls a variety of data from a table (the same query is used elsewhere), pushing the grouped summary of results of one field to a page. We need to add another field (a description) to the array, at the $tmp_array[] = $row[3] level, so that the array consists of $row[3] and $row[10]. The end result should be:
echo "<td>$key:</td><td>$val ($row10val)</td>";
which replaces the existing
echo "<td>$key:</td><td>$val</td>";
I haven't a clue as to how to do this...
$num = mysql_num_rows($array);
$tmp_array = array();
if ($num > 0){
mysql_data_seek($array, 0);
while ($row = mysql_fetch_row($array)){
if (($row[1] >= $start) && ($row[1] < $finish)){
$tmp_array[] = $row[3];
$i++;
}
}
sort($tmp_array);
$a_count = array_count_values($tmp_array);
while (list($key, $val) = each($a_count)) {
echo "<tr>";
echo "<td>$key:</td><td>$val</td>";
echo "</tr>";
}
echo "<tr><td><b>Total:</b></td><td><b>$i</b></td></tr>";
echo "</table><p>\n";
}