I am just wondering what's the most efficient way to export mysql data to excel file using PHP. I have been searching on web but not sure what the best way is. Any thoughts? Thanks for help.
You could try this PHPExcel - OpenXML Api: http://www.phpexcel.net
I never tested that, but the feature list says that it can export data to
Excel 2007 (spreadsheetML)
BIFF8 (Excel 97 and higher)
PHPExcel Serialized Spreadsheet
CSV (Comma Separated Values)
HTML
PDF
Good luck!
Related
I want to fetch data from consumerfinance.gov and import it into an Excel spreadsheet. Any ideas on how to accomplish this?
Why don't you try out our OData API, which would allow you to consume those datasets directly within Excel without needing to write any VBA at all?
Edited: All right, since it sounds like OData isn't an option, how about a Web Query? You can us the CSV export (Export -> Download -> CSV) or the CSV format from SODA and I think that'd still work in 2007.
I have a 1.9GB tab delimited file that is in the form of an xlsx file. I could write a script to convert it to CSV and then convert THAT to json, but I'm just curious if there is a more direct way to do this. Thanks! :)
Not sure if this is an option, but you can import it into some database (for example mongo) and then export relatively easily with that
I came accross a similar problem recently, and what I found really easy to do was actually go directly from XLSX to JSON using MATLAB.
IMPORTING XLSX: https://www.mathworks.com/help/matlab/ref/xlsread.html
EXPORTING JSON: https://www.mathworks.com/help/matlab/ref/jsonencode.html
It might take a little bit of time for such a large file, but I did it on a file about 400MB in size with no problem.
There are various utilities that allow you to convert an SQLite file to HTML format. What I am looking for is a script that would let you do this, in perl or something maybe? How would I go about finding / doing this?
Thank you :)
Are you talking about dynamic generated pages? In that case just use a while loop that gets content from the database and presents them in a table.
If you just want to export it to html once, you can use export as an excel stylesheet. From excel you have the option to 'save as html'.
I'm saving out a .csv file from Excel and importing it to a MySQL database (with phpMyAdmin 2.6.4-pl3).
A few fields have trademark symbols. but show up as "ª". I thought it was something to do with the encoding of the fields form the database, but I have changed them and found no difference. UTF-8 at least shows the small 'a,' while others I have tried just convert it to a '?'. If I leave it at UTF-8 and manually go in after importing the .csv to change the 'ª' to '™' it works fine, but since I have about 150 products that would take forever.
I think the issue is that Excel does not export the .csv file as UTF-8, so the character gets lost. I am exporting this information to a PDF so I cannot use any standard web workarounds like I have seen on other posts.
Any ideas on a way to fix this? Thanks.
MySQL allows the specification of the encoding for each database. Either change the database's encoding to something useful, like UTF-8, or convert your input data to the current database encoding.
Use Open office SpreadSheet to import data into sql instead of Excel and CSV / txt file.
You can convert Excel or CSV into open office spreadsheet and import in phpMyAdmin
I am creating a website...and i want to give a liberty to users, to upload the data of excel file and then i want to save that excel data inside mysql database on runtime...
kindly help me in performing this task...
you can mail me at...."amiteshsinha09#rediffmail.com"
thank you
Amitesh
You can query the data in the excel sheet using Open Xml
Using this instead of running Excel via interop is both faster, more stable and saves you licence costs.