What is the better way? Array or MYSQL?

Hey!

The title sounds a bit wrong, but what i mean is:

If i have a database with many different entries and i collect the data into flash via XML what is the better way to sort it out? Is it easier to load different PHP/XML Files for every query i have or is it easier to load the whole database via one xml into an array and make the queries with that array?

by queries i mean f.e. Sort by Id, sort by date, select where id=something

easy to do for me with SQL/PHP, but i dont know (yet) how capable arrays are…
What ways to you use?

Cheers