prepare(\"SELECT p_id FROM players_to_team WHERE t_id = ?\");
$t
Try replacing $player[] = array();
by $player = array();
at the beginning (line 2).
This is because that you declare an array at the index 0 of this variable which is told to be an array because of the []
. You therefore try to place an array in your array, making it multidimensional.
You cannot simply echo
an array. echo
can only output strings. echo 'foo'
is simple, it's outputting a string. What is echo
supposed to do exactly in the case of echo array('foo' => 'bar')
? In order for echo
to output anything here, PHP will convert array('foo' => 'bar')
to a string, which is always the string "Array"
. And because PHP knows this is probably not what you want, it notifies you about it.
The problem is you're trying to treat an array like a string. Fix that.