Creating an Excel spreadsheet via PHP has been covered in previous posts here, but when I tried it it never seemed to work correctly.
You could always create a comma-separated file, which can be read by all (or a good majority) of databases. Use the fopen/fwrite/fclose commands to create the file.