I am trying to step throgh an array using foreach, but I am not getting it right so advice would be appreciated.
I have simplified this
I have pulled some data into an array from MySQL using
$row= @mysql_fetch_array;
and the array looks like
( [0] => user1 [user_id] => user1 [1] => test [dept] => test [2] => 3 [section] => 3 [3] => 20040422210535 [date] => 20040422210535 )
I try to step through it using
foreach($row as $value){
echo $value["user_id"];
echo $value["dept"];
echo $value["section"];
echo $value["date"];}
but the output is:
u
u
t
t
3
3
2
2
clearly I'm getting something very wrong