I'm familiar with how to access the backend database and retrieving and displaying data with a SELECT statement. What I'd like to do is create a file that contains the data retrieved instead of displaying it:
- The user's on page abc.php.
- Click on a report button that's tied to report.php.
- report.php works in the background accessing the database, issuing a SELECT statement, and then prompts the user for a local filename in which to store the resulting output (it will be formatted with delimiters that will make it available for import into Excel, Access, etc.).
- The output is stored in the filename specified by the user.
- report.php redirects back to abc.php.
Can someone point me in the right direction?
I'm guessing this is just a matter of using I/O functions like fopen() and fwrite(); but do these functions work on files on the user's local filesystem, or do they look for files on the server? And is there a handy-dandy class/function that will present the user with the standard "Open file" dialog box?
Thanks,
Rich