PHP Export data, formatted as CSV without Phpexcel class, is there any other way? How should I write a class? Thanks a lot!
Reply to discussion (solution)
$fp = fopen (' CSV file name ', ' W '), $rs = mysql_query (' select * from Tbl_name ') and while ($row = Mysql_fetch_assoc ($rs) { fputcsv ( $FP, $row);} Fclose ($FP);
Moderator Positive Solution +1
If the data is large, it will be slow to write.
You write in PHP code, slow is normal
If you have access to the database directory, you can also build a engine=csv table to copy the data in
Let's talk about where to export the data.
Export the data queried in the database!
"; Processing the data here } }
Backstage, slow down, it's okay.
For users, you have to consider limiting the frequency of user use
or other ways to speed things up, like extensions or something.
Slow and this code seems to be okay not to query the database