I have a table in excel with more than 300 lines and I would like to insert the data of this table in mysql in phpmyadmin
Currently php usage
Thank you for your attention!
I have a table in excel with more than 300 lines and I would like to insert the data of this table in mysql in phpmyadmin
Currently php usage
Thank you for your attention!
If it is a job that will be done only once and / or is migrating from an excel to your bank, you can download MySQL Installer
which has several tools in:
Here is a preview of it:
Now if the intention is to actually work .xls and .xlsx documents with PHP via upload then I recommend that you keep in mind that much of you will have to develop:
First the document will be uploaded using move_uploaded_file
Then use the link to extract the document data, the formats supported by PhpSpreadsheet
are:
To install you need to use the composer, if you already have composer installed then via CMD or terminal navigate to the project folder and run the command:
composer require phpoffice/phpspreadsheet
Then in your document you will have to have something like after the upload:
<?php
require 'vendor/autoload.php';
use PhpOffice\PhpSpreadsheet\IOFactory;
... upload vai aqui ...
//Arquivo upload
$inputFileName = './upload/example1.xls';
$spreadsheet = IOFactory::load($inputFileName);
Then to access the cells of the document use link
For example, cell phone B8:
$spreadsheet->getActiveSheet()->getCell('B8');