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
Release: 2016-10-10 11:56:10
Original
1947 people have browsed it

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 '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?

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 '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?

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

Related labels:
php
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!