Hi,
I'm trying to create a 3 dimensional array, that will information for users from a database. My code is...
$sql = "SELECT val1,val2,val3 FROM table where user_id='113'";
$result=mysql_query($sql);
while($rw=mysql_fetch_array($result)){
$array = array( array( type=>"$rw[val1]",
code=>"$rw[val2]",
request=>$rw[val3]));
for ($row = 0; $row < 3;$row++){
while ( list( $key, $value) = each( $array[ $row ])){
echo "|$value";
}
}
}
However I get an error saying...
Warning: Variable passed to each() is not an array or object
However it still echo's all the values of the array. I've got it to get 3 different records. So it looks like its working, but I don't know why this error is coming up.
Regards
Ben