Skip to content
MNB PHPExcelDeveloper Guide
AI
Standalone Database package

PHP Database Import Library for PDO Mapping & Validation

Use the standalone MNB PHPExcel Database package when your application already has iterable rows and needs format-neutral PDO imports with mapping, validation, batching, duplicate handling, domain presets, manifests, or failed-row reporting.

Composer
composer require mnb/mnb-phpexcel-database:^2.0
Package
mnb/mnb-phpexcel-database
Entry API
Mnb\PHPExcel\Import\SqlImporter
Runtime
PHP 8.1+
Format
Iterable rows → PDO

Choose your Database workflow#

Use the right Database API#

TaskPrimary APIChoose it when
Import iterable rows into PDOSqlImporter::importRows()You already have normalized rows and need mapping, validation, batching, inserts/updates, and duplicate handling.
Run a domain-oriented importDomainImporter::create()Application presets, aliases, validation rules, previews, templates, or domain-specific defaults should sit above the generic SQL engine.
Build a PDO connectionDatabaseConnectionFactory::make()Configuration values need to become a consistent PDO connection with package-level defaults.
Stream very large XLSX directly to PDOLargeExcelDatabaseImportEngineUse the separate mnb/mnb-phpexcel-database-xlsx bridge when XLSX chunk orchestration itself belongs to the job.

What the standalone Database package covers#

Import

Format-neutral PDO writes

  • Arrays, generators, cursors, and normalized format sessions
  • Batched inserts and update strategies
  • Prepared statements and transaction controls
  • Duplicate skip/update behavior with unique keys
Quality

Mapping and validation

  • Explicit source-to-column maps and aliases
  • Normalization, defaults and validation rules
  • Preview/dry-run workflows before writes
  • Original source-row tracking and failed-row reports
Operations

Production import workflows

  • Domain presets and reusable application profiles
  • Progress callbacks, manifests and resume state
  • Batch sizing and replay-safe strategies
  • No spreadsheet-format dependency unless you add one

Package boundary: mnb/mnb-phpexcel-database owns format-neutral PDO workflows. Add CSV, XLS, XLSX, JSON, XML, or ODS separately only when this package must open that source format. Use the monolithic package instead when one application intentionally owns the complete toolkit.