I have a problem with my project. i want to import Excel sheet directly into mysql database for PHP language without any conversion of Excel sheet into another format. i am very fed about this from last two weeks. So Please help me How I Do it. any expert please help me
You can refer to this question: Reading an Excel file in PHP
Read the excel file using either PHPExcel or PHPExcel Reader (or any other preferred php lib...)
As you are reading the file, insert the data you read into your database.
Related
I'm using PHPexcel library to import data from excel file to MySQL by using Ajax and PHP. It works fine with the old format excel file sample.xls (The Excel 97 - Excel 2003).
But I want to import data from sample.xlsx format. PHPexcel not working with this format.
I searched but can't find a solution. Any help will be highly appreciated.
PHPexcel is deprecated. The library is deprecated since 2015, so I guess that is why they does not support xlsx format. You should use PhpSpreadsheet instead. It supports xlsx format as well.
Here is a good article that explains how to migrate from PHPexcel to PhpSpreadsheet
Article
I have to code a PHP platform for importing an Excel file (quite heavy) to fill an SQL server database.
To do so I used the library PHP-excel-reader (https://code.google.com/archive/p/php-excel-reader/downloads) to be able recover the value of specific cells (eg $ water = $ data-> val (13, 'A');) everything works fine except that PHP-excel-reader is only compatible with .xls not .xlsx, if I go directly convert my files in excel no problem.
But so that the user does not have to do this operation every time I want automated converting .xls .xlsx has.
I tried to use PHPExcel (http://phpexcel.codeplex.com/) but nothing works all the file converted by the libraries do not work on PHP-excel-reader. Would you have a solution?
If there is no solution do you have knowledge of another library that allows like PHP to store the value of an Excel cell in a variable?
I am desperate. Thank you in advance for your help. Sorry for my English I'm french x)
For those interested, I found a solution. It is used the SimpleXLSX library (http://www.spyrozone.net/hacking/2011/05/php-parse-and-retrieve-data-from-xlsx-files.jsp), it will return from to an .xlsx an array of values where it will be to recover each cell value. if you have a problem with date conversion check this ( https://www.ablebits.com/office-addins-blog/2015/07/01/excel-convert-time-decimal/)
I'm exporting data in excel sheet via drupal view. Drupal views_export_xls module uses
http://code.google.com/p/php-excel/source/browse/branches/class-excel-xml.inc.php?r=9
library to export data into excel sheet. Every thing working fine. But i want little more from it.
How to add MACRO in excel sheet row or cell programmatically?
Is it possible to do so by php code?
If you look at above link - line no 88 & 93 which actually create cells and rows.
What i want to create a macro and place it on excel sheet that can later convert this generated excel file into native xml (.in) file for business purpose.
I've searched a lot but most of the link suggesting VB solution and i've no sense about this language.
Can anyone point me on right direction.
Any help would be greatly appreciated!
As far as I'm aware, unless the Excel writer that you're using is based around COM, then there is no way of creating a Macro in an Excel workbook.
hi i want to converted my excel file into sql file can any one know what should i do for converting? i dont know how to converted.
thanks
Use sql convertor from below link
http://www.sqlconverter.com/
OR
You need to convert the .xls file to .csv(comma seperated file) and then use the loader to load the data if you want to load the .xls data to database.
Try Navicat products.
I used Navicat for MySQL for example and it provides great flexibility in Importing Excel sheets in Mysql tables.
From there you can run any type of SQL query
Here is web application tool that allows fast Excel to MySQL conversion.
Excel data does not have a Schema by default and this tool allows you to define it interactively with the help of a wizard.
Input
An Excel (xls / xlsx) data file, whose format is given in the documentation they provide.
Output
A .sql export file (which can be imported into a MySQL database) is available for download after the conversion is done. (And it works pretty fast)
The other option is to export to CSV first. Excel can export to CSV and then MySQL can import CSV via LOAD command or PHPMyAdmin. The schema should be defined before. Its a little longer process.
There is one excel sheet which contains student name, rollno etc. How can i parse the contents of excel file and store that in my sql database?
You are looking for PHPExcel library i believe.
http://phpexcel.codeplex.com/
use this class to read the excel files
http://sourceforge.net/projects/phpexcelreader
If you want to do it directly from the Excel file, rather than create an intermediate CSV using Excel's "Save As" options, then look at libraries such as PHPExcel that can read the xls binary format and make the data accessible to your PHP script.
I'd recommend to you that you save it as csv, it's much more easier and less hacking to upload it to the database
here is simple a sample
http://www.bradino.com/php/csv-upload-to-database/
PHPExcel is one of the best PHP classes i have ever worked with. In addition to parsing and reading files of all Excel variations (including csv) the output to Excel 2007 + is excellent.
Be sure to look at the documentation and examples...they will get you up to speed very quickly