PHPackages                             thecsea/mysqltcs - 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. thecsea/mysqltcs

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

thecsea/mysqltcs
================

The simplest and the most powerful library to access to a mysql database, optimizing the connections and allowing you to perform common database actions immediately and efficiently

v3.1.0(10y ago)12551GPL-2.0PHPPHP &gt;=5.3.0

Since Jul 18Pushed 10y ago2 watchersCompare

[ Source](https://github.com/thecsea/mysqltcs)[ Packagist](https://packagist.org/packages/thecsea/mysqltcs)[ Docs](http://www.thecsea.it/progetti/classi_db/)[ RSS](/packages/thecsea-mysqltcs/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (2)Versions (8)Used By (1)

mysqltcs
========

[](#mysqltcs)

Build status: [![Build Status](https://camo.githubusercontent.com/aca6afeb3558c309bb3138b2f04e1f00cafc9427218ffd10785d786ba97f2bd4/68747470733a2f2f7472617669732d63692e6f72672f746865637365612f6d7973716c7463732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/thecsea/mysqltcs) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/d679ce02a83dfc4f0cfa345ab7f3c11ffc532c3a863af3adcff0510133f0d59e/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f746865637365612f6d7973716c7463732f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/thecsea/mysqltcs/?branch=master) [![Code Coverage](https://camo.githubusercontent.com/e8ae9f49b49440a206ff1a4a49e627778ab520be9f4c7dad2c4ceb6c3c9f5486/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f746865637365612f6d7973716c7463732f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/thecsea/mysqltcs/?branch=master) [![Build Status](https://camo.githubusercontent.com/4e50b77c97933af95b6c387686c5c4c14e750aaf0e816461300a7c5ffd43de5f/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f746865637365612f6d7973716c7463732f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/thecsea/mysqltcs/build-status/master) [![Latest Stable Version](https://camo.githubusercontent.com/84bde289bd0d2768df51e56da43faa1e28fe563f80d9c5fbb20dff4adb496b4c/68747470733a2f2f706f7365722e707567782e6f72672f746865637365612f6d7973716c7463732f762f737461626c65)](https://packagist.org/packages/thecsea/mysqltcs) [![Total Downloads](https://camo.githubusercontent.com/1f14ffdf6495a80254683ae3cdcd4c3aecb062ac230642555482947617ac95d4/68747470733a2f2f706f7365722e707567782e6f72672f746865637365612f6d7973716c7463732f646f776e6c6f616473)](https://packagist.org/packages/thecsea/mysqltcs) [![Latest Unstable Version](https://camo.githubusercontent.com/d7bb383c1e749586d07bc4e828cf90f438ee63f87122ab3a426d2e6f1615d8c4/68747470733a2f2f706f7365722e707567782e6f72672f746865637365612f6d7973716c7463732f762f756e737461626c65)](https://packagist.org/packages/thecsea/mysqltcs) [![License](https://camo.githubusercontent.com/5b25e5d7070828e5ed4a0b32d38f5e44efaf2bb06662b09638fe0867cb40d8f6/68747470733a2f2f706f7365722e707567782e6f72672f746865637365612f6d7973716c7463732f6c6963656e7365)](https://packagist.org/packages/thecsea/mysqltcs)

The simplest and the most powerful library for mysql written in php:

- You can use the same db connection in more than one instances (optimizing mysql physical connections)
- This library allow you to make common database operations immediately and efficiently, returning simple data structures
- Log all actions performed on db
- All mysql error as exception
- Clone support
- Transactions support

Download, install and use
=========================

[](#download-install-and-use)

Download
--------

[](#download)

### via git

[](#via-git)

Clone repository

`git clone https://github.com/thecsea/mysqltcs.git`

### via composer

[](#via-composer)

download composer here

add the following dependence in `composer.json`

`"thecsea/mysqltcs": "3.0.*"`

or type

`php composer.phar require thecsea/mysqltcs`

\##Install/Update Update composer (download composer here )

`php composer.phar self-update`

Followings commands must be executed in project root directory

\###Install mysqltcs

`php composer.phar install`

\###Update mysqltcs

You can perform an updated if you have added mysqltcs as composer dependency

`php composer.phar update`

You have to perform an update when a new version is released

\##How to use

When composer installation is finished you will see `vendor/autoload.php` that is the auload generated by composer. If you have set `mysqltcs` as composer dependence the autoload loads both mysqltcs and other dependecies. So you just have to include autload in each file where you want use mysqltcs and create the mysqtcs object in the following way:

`$connection = new it\thecsea\mysqltcs\Mysqltcs(...);`

or

`use it\thecsea\mysqltcs\Mysqltcs;` and `$connection = new Mysqltcs(...);`

You can see [examples](#examples) to understand how to use library

You can also take a look to [wiki](https://github.com/thecsea/mysqltcs/wiki) to see the detailed description or go to generated [phpdoc documents](http://thecsea.github.io/mysqltcs/namespaces/it.thecsea.mysqltcs.html) (documentations of all classes)

Tests
=====

[](#tests)

Mysqltcs is tested with automatic test: phpunit test. So we have a good chance of not having errors, but not the certainty. But we have covered the following percentage of statements with tests: [![Code Coverage](https://camo.githubusercontent.com/e8ae9f49b49440a206ff1a4a49e627778ab520be9f4c7dad2c4ceb6c3c9f5486/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f746865637365612f6d7973716c7463732f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/thecsea/mysqltcs/?branch=master)

- Change db data in `tests/config.php`
- Import `tests/mysqltcs.sql`
- Execute the unit tests:

1. Go in the root directory
2. Type `phpunit` or if you have downloaded the phar `php phpunit-xxx.phar`

In fact `phpunit.xml` contains the correct test configuration

**CAUTION**: each time tests are executed, the database must be in the initial state, like the import has just been executed (you should have a empty table, only the db structure)

\#Examples You can find some examples under `examples` to run it:

- Change db data in `examples/config.php`
- Import `examples/mysqltcs.sql`

There is a simple example `simpleExample.php` that shows you how to use the library in the simplest way

There are not examples about transactions yet (you have to remember to set autocommit to true after using transactions)

N.B. if you have added mysqltcs as composer dependency you will find example under `vendor/thecsea/mysqltcs/examples`

By [thecsea.it](http://www.thecsea.it)
======================================

[](#by-thecseait)

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 97.1% 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

Every ~13 days

Recently: every ~20 days

Total

7

Last Release

3878d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/280e8cda025e47f1005450604314ec83a21dc771a405e64c071c9f4f5f822224?d=identicon)[carduz](/maintainers/carduz)

---

Top Contributors

[![carduz](https://avatars.githubusercontent.com/u/10631614?v=4)](https://github.com/carduz "carduz (132 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (4 commits)")

---

Tags

mysqlSimplepowerfulefficientoptimized

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/thecsea-mysqltcs/health.svg)

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

###  Alternatives

[doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.

9.7k578.4M5.6k](/packages/doctrine-dbal)[kirschbaum-development/eloquent-power-joins

The Laravel magic applied to joins.

1.6k25.2M34](/packages/kirschbaum-development-eloquent-power-joins)[scienta/doctrine-json-functions

A set of extensions to Doctrine that add support for json query functions.

58723.9M36](/packages/scienta-doctrine-json-functions)[cytopia/mysqldump-secure

Secure mysqldump script with encryption, compression, logging, blacklisting and Nagios monitoring integration

1474.7k1](/packages/cytopia-mysqldump-secure)[ark/database

Light weight database abstraction

117.8k](/packages/ark-database)

PHPackages © 2026

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