PHPackages                             exceldb/dbtoexcel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. exceldb/dbtoexcel

ActiveLibrary[Database &amp; ORM](/categories/database)

exceldb/dbtoexcel
=================

PHP script to simplify the process of converting database table to excel sheet.

1.0.0(3y ago)514PHP

Since Feb 6Pushed 3y ago1 watchersCompare

[ Source](https://github.com/91ahmed/DbtoExcel)[ Packagist](https://packagist.org/packages/exceldb/dbtoexcel)[ RSS](/packages/exceldb-dbtoexcel/feed)WikiDiscussions main Synced today

READMEChangelog (1)DependenciesVersions (2)Used By (0)

DbtoExcel
---------

[](#dbtoexcel)

PHP script to simplify the process of converting database table to excel sheet.

### \# Requirements

[](#-requirements)

- PHP 7.0 or higher
- Composer for installation

### \# Install

[](#-install)

via composer

```
composer require exceldb/dbtoexcel

```

### \# Example

[](#-example)

```
// don't forget to import vendor/autoload.php
require('vendor/autoload.php');

// Database information
$extract = new Database\Excel\ExtractExcel([
      'driver' => 'mysql',
      'host' => '127.0.0.1',
      'username' => 'root',
      'password' => '',
      'database' => 'test',
      'port' => '3306',
      'charset' => 'utf8',
      'sslmode' => 'disable'
]);

$extract->table('users'); // Specify the database table.
$extract->columns('*'); // Specify the columns you need to extract.
$extract->execute(); // Execute the script.
```

### \# Description

[](#-description)

The **TableToExcel** class constructor takes one parameter, which is an *(array)* of the database information.

`table()`

This method used to specify the database table you need to extract, it takes one parameter *(string)* which is the name of the table.

`columns()`

Used to specify the columns you need to extract from the database table, it takes one parameter *(string)* which is the column's names.

To extract all columns just add **asterisk (\*)** or leave the parameter empty while if you want to extract specific columns you can write the columns names following by comma separator.. see the example below.

```
use ExtractDatabaseToExcel\TableToExcel;

$extract = new TableToExcel([
      'driver' => 'mysql',
      'host' => '127.0.0.1',
      'username' => 'root',
      'password' => '',
      'database' => 'test',
      'port' => '3306',
      'charset' => 'utf8'
]);

$extract->table('users');
$extract->columns('username, email, age'); // Extract specific columns
$extract->execute();
```

`execute()`

This is the last method you should invoke to execute the script, the method will convert the data and download the excel file.

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1242d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/44722367?v=4)[Ahmed Hassan Hassan](/maintainers/91ahmed)[@91ahmed](https://github.com/91ahmed)

---

Top Contributors

[![91ahmed](https://avatars.githubusercontent.com/u/44722367?v=4)](https://github.com/91ahmed "91ahmed (17 commits)")

---

Tags

databasedatabase-tablesexcelexport-to-excelphp

### Embed Badge

![Health badge](/badges/exceldb-dbtoexcel/health.svg)

```
[![Health](https://phpackages.com/badges/exceldb-dbtoexcel/health.svg)](https://phpackages.com/packages/exceldb-dbtoexcel)
```

###  Alternatives

[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k117.2M118](/packages/jdorn-sql-formatter)[propel/propel1

Propel is an open-source Object-Relational Mapping (ORM) for PHP5.

8351.6M87](/packages/propel-propel1)[jfelder/oracledb

Oracle DB driver for Laravel

11518.4k](/packages/jfelder-oracledb)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
