Home  >  Article  >  Backend Development  >  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?

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?

WBOY
WBOYOriginal
2016-10-10 11:56:101941browse

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
How to set a

How to set a

Reply content:

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
How to set a

How to set a

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

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn