Home >Backend Development >PHP Tutorial >How to set a 'download' button on the web page for data queried from the Mysql database, and then save it to the local computer in txt format?
After transmitting the real-time data to the server, the user can query the data for a certain period of time as needed, and then can choose to download the queried data to a designated location on the local computer
After transmitting the real-time data to the server, the user can query the data for a certain period of time as needed, and then can choose to download the queried data to a designated location on the local computer
Use the Blob object in js to process, construct the data into a Bolb object, and then generate a download link, it is very easy. But the browser needs to support html5.
Export and save the database program in the form of txt to the server, and then generate a download link, and the user clicks to download
Use INTO OUTFILE of the SQL statement to export the query results into a txt file, and then return this file to this request