@killy, if you want the results to be on the server instead of sent to the client you will want to use fopen() and fwrite() in order to write the contents to a local file (obviously the file/folder will need to be writable by whatever user you are running php as - I believe its generally the apache user, depending on your setup of course).

i'm kinda new to php. i help run a competition with teams from schools all over the country. i've got a page that allows a user to select a variable [a specific school, in this case] from a dropdown. this variable is then part of a query that returns some results specific information about the number of teams from the selected school and outputs them to a table. I'd like to be able to export that same query to csv. Do you all have any thoughts on how I could do that? Thanks much.

i'm kinda new to php. i help run a competition with teams from schools all over the country. i've got a page that allows a user to select a variable [a specific school, in this case] from a dropdown. this variable is then part of a query that returns some results specific information about the number of teams from the selected school and outputs them to a table. I'd like to be able to export that same query to csv. Do you all have any thoughts on how I could do that? Thanks much.