The easiest way to get the downloaded data to load up in Microsoft Excel on Windows machines is to output it in simple delimited text, like a
CSV file. Just copy the following into a text editor, save it as .csv, and Excel will probably open it by default, or if you load it into Excel, it will figure out that it's a comma-separated values file and display each field in its own cell:
12038470, James, Brown, 123 Sesame Street, Miami, Florida
29837473, Frank, Jones, 55 Sunset Blvd, Hollywood, California
So, pull your data out of the database, create a file out of it like the above, and give that to the user, and tell them to open it in Excel (although on Windows .csv files tend to open in Excel by default). From there, they could actually save it as a .xls file if they wanted to.