PhpSpreadsheet is a library written in pure PHP and offers a function to export data from DB to Spreadsheet and a function to import data from Spreadsheet to DB
Microsoft SQL Server And SQLite is Supported For importing to Microsoft SQL Server from Microsoft Excel.
Only Microsoft Excel is Supported. And only import to Microsoft SQL Server from Microsoft Excel.
Use composer to install PhpSpreadsheetDB into your project:
composer require siokobu/phpspreadsheetdb
Often PhpSpreadsheetDB to help PHPUnit test.
composer require --dev siokobu/phpspreadsheetdb
$connectionInfo = array(
"Database" => $database,
"UID" => $uid,
"PWD" => $pwd,
"CharacterSet" => $charset);
$sqlSrv = new SQLSrv($hostname, $connectionInfo);
$sqlSrv->insertData($tableName, $excel);