2D arrays

From: Date: Fri, 08 Dec 2000 02:26:20 +0000
Subject: 2D arrays
Groups: php.general 
Request: Send a blank email to php-general+get-29273@lists.php.net to get a copy of this message
Hello, I cannot get any data into my 2D array. The documentation suggests declaring 2d arrays in this fashion" <snip> $dat = array(); $dat = array_push($dat, array()); $ff = array(); while ($j < $numfields) { $ff[$j] = mysql_field_name($r,$j); print "ff=$ff[$j]<br>"; $j++; } $i=0; $j=0; while ($i < $numresults) { while ($j < $numfields) { $dat[$j][$i] = mysql_result($r,$i,$ff[$j]); print "dat=$dat[$j][$i]<br>"; $j++; } $i++; } reset($dat); // resets the pointer to be at the beginning $numfields and $numresults contain real numbers, AND the $ff 1D array is also fine. This is the error message: Warning: Cannot use a scalar value as an array in main_user.php on line 101 dat=[0] I am lost, and any help is appreciated! thanks -tom

« previous php.general (#29273) next »