[eluser]PhilTem[/eluser]
It's because you're accessing an object as if it were an array (exactly what the error code tells you). Your code snippet shows the "bad code" at around the "$query[' "-part.
Try changing the access scope from array to object. Then it should work