承接 frantzley/excel-to-mysql-web 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

frantzley/excel-to-mysql-web

Composer 安装命令:

composer require frantzley/excel-to-mysql-web

包简介

Professional PHP package to import Excel files into MySQL with validation and upsert

README 文档

README

A PHP package that allows you to import data from Excel files (.xls / .xlsx)
into a MySQL database with a full set of powerful features.
It is designed for developers and users who need fast data processing,
offering a simple UI with advanced functionalities such as live logs,
a progress bar, and log filtering.

🛠 Features

- Automatically creates the database if it does not exist.
- Automatically creates tables based on Excel headers.
- Supports Excel files with multiple sheets.
- Automatic insert/update data handling.
- Unique key support to prevent duplicates.
- Dynamic logs with filtering (insert, update, exists, error, info).
- Progress bar to track import progress.
- Connection error messages displayed in UI logs.
- Responsive UI built with Tailwind CSS and glassmorphism effects.

---

💻 Installation


Enstale via Composer:

composer require frantzley/excel-to-mysql

Estrikti Projet an


project-root/
├─ public/
│  ├─ index.php      # Upload form and UI
│  ├─ app.js         # JavaScript file
│  ├─ process.php    # Backend processing (pre-built)
├─ src/
│  └─ ExcelToMySQL.php
├─ uploads/          # Folder for uploaded files (auto-created if not exists)
├─ vendor/           # Composer dependencies

Asire w gen PhpSpreadsheet enstale:

composer require phpoffice/phpspreadsheet

⚡ Usage

Open your browser at public/index.php.

Select your Excel file, enter the table name in the database, and define a unique key if needed.

Click Upload & Import.

Logs will appear in real time with color indicators:

Blue → new insert  
Yellow → already exists  
Red → error  

🔧 Column Mapping

Automatic: The first row in the Excel file is used as headers; database columns will match these names.

Manual: You can customize column mapping if needed:

$importer->setMapping([
    "Excel Name"  => "db_name",
    "Excel Email" => "db_email"
]);

The table will be created automatically based on the mapping.

📦 Example pou test PHP Usage


<?php
require __DIR__ . '/vendor/autoload.php';

use Frantzley\ExcelToMySQL;

// Koneksyon PDO
$pdo = new PDO("mysql:host=localhost;dbname=testdb;charset=utf8mb4", "root", "");
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

// Inisyalize importer
$importer = new ExcelToMySQL("chemin/fiche.xlsx", $pdo);

// Opsyonèl: mete non tab la ak kle inik
$importer->setTableName('users');
$importer->setUniqueKey('email');

// Kreye tab si li pa egziste
$importer->createTableIfNotExists();

// Insert / Update done
$rows = $importer->getRowsFromExcel();
foreach ($rows as $row) {
    $importer->insertOrUpdateRow($row);
}

// Summary
print_r($importer->getSummary());


⚙ Requirements

PHP >= 8.0

MySQL

PhpSpreadsheet

✅ Key Point pou Itilizatè

You do not need to create process.php. All backend processing is already included in the package.

You only need to run the project and open index.php in your browser to launch the web interface, upload your Excel file, and track logs (insert / exists / error) in real time.

All required folders (uploads/) are automatically created if they do not exist.

Pake a sipòte:

1. Automatic Database Creation

If the database does not exist → it is created automatically with a log:
Database 'xxx' did not exist, it was created automatically ✅

If it already exists → it is not recreated:
Database 'xxx' already exists ⚠️

If a connection error occurs → log message:
Database connection error 'xxx': [error details] ❌

2. Automatic Table Creation

Tables are created based on Excel headers.

Empty headers are ignored.

Completely empty rows are removed.

3. Insert / Update

Inserts new rows if they do not exist.

Updates rows if the unique key already exists.

Logs display each action.

4. Dynamic Logs

Filter logs by type (insert, update, exists, error, info).

Log container adjusts height dynamically.

Auto-scroll to the latest log.

5. Progress Bar

Displays import progress based on the number of rows processed.

frantzley/excel-to-mysql-web 适用场景与选型建议

frantzley/excel-to-mysql-web 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 1, 最近一次更新时间为 2025 年 09 月 13 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 frantzley/excel-to-mysql-web 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 frantzley/excel-to-mysql-web 我们能提供哪些服务?
定制开发 / 二次开发

基于 frantzley/excel-to-mysql-web 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 26
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-09-13