> > $res = mysql_query ("SELECT COUNT(deptid) FROM maintenance GROUP BY
> > deptid");
> > $deptcount = array(); // reset the array
> > while ($row = mysql_fetch_row ($res)) {
> >   $deptcount[] = $row[0];
>
> this should be $deptcount[] .= $row[0]; shouldn't it?

No. The way it's written is it's adding an element onto the array with each
loop. It's basically the same as doing

array_push($deptcount,$row[0]);

---John Holmes...


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to