Simulate an array in MySQL

Using a cursor I want to filter a set of data and keep it in an object and then process it in PHP. I thought of a kind of array to keep them.