You can't set an array subscript using an array; it should be a numerical
value or a string.
What you want to do is
$division[$div_id] = $array;
Better yet, try:
$divison[$div_id] = mysql_fetch_array($result, MYSQL_ASSOC);
Steve Buehler wrote:
> I am trying to learn some new things in the hopes that it would help me
> with my mysql/PHP programming. The following code gives me an error: "
> Warning: Illegal offset type in z.php on line 25 ".
> $result=mysql_query("SELECT * FROM division");
> $array=array("sub1" => $row->sub1,
> "sub1d" => $row->sub1d,
> "sub2" => $row->sub2,
> "sub2d" => $row->sub2d,
> "sub3" => $row->sub3,
> "sub3d" => $row->sub3d,
> "sub4" => $row->sub4,
> "sub4d" => $row->sub4d,
> "sub5" => $row->sub5,
> "sub5d" => $row->sub5d,
> "game_length" => $row->game_length);
> // The following is the line 25
> What I am trying to do is to be able to later call
> etc... I sure hope that this can be done. If not, I will just have to
> stick with temporary tables.
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php