Saving data in a table to a file when the user clicks a link

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
SBukoski
Forum Contributor
Posts: 128
Joined: Wed May 21, 2003 10:39 pm
Location: Worcester, MA

Saving data in a table to a file when the user clicks a link

Post by SBukoski »

I am creating a tool where users will be able to keep track of a product checklist online. All the information pertaining to each checklist is saved in MySQL tables.

What I would like to be able to do is allow the user to click a Download link, which will take all of the data in the tables pertaining to their checklist and save it in a comma delimited file for them to save locally.

How can I do this so a temporary file is created, downloaded and then deleted? I haven't begun to dig into looking at ways to do this yet, so I thought I might as well start here.
Post Reply