PHPackages                             pjanisio/simpledb - 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. pjanisio/simpledb

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

pjanisio/simpledb
=================

A simple database abstraction layer

2.4.36(1y ago)06MITPHPPHP &gt;=7.4

Since Jun 7Pushed 1y ago1 watchersCompare

[ Source](https://github.com/PJanisio/simpledb)[ Packagist](https://packagist.org/packages/pjanisio/simpledb)[ Docs](https://github.com/PJanisio/simpledb)[ RSS](/packages/pjanisio-simpledb/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (3)Versions (2)Used By (0)

SimpleDB - simple Mysql abstraction class
=========================================

[](#simpledb---simple-mysql-abstraction-class)

[![PHPUnit](https://camo.githubusercontent.com/e9d81097da849c430f6199f767d1bc5fb1ed368333048799a6e08535124ea34b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f504a616e6973696f2f73696d706c6564622f7068702e796d6c3f6272616e63683d6d6173746572266c6162656c3d7465737473266c6f676f3d706870756e6974)](https://camo.githubusercontent.com/e9d81097da849c430f6199f767d1bc5fb1ed368333048799a6e08535124ea34b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f504a616e6973696f2f73696d706c6564622f7068702e796d6c3f6272616e63683d6d6173746572266c6162656c3d7465737473266c6f676f3d706870756e6974)

Main goals
----------

[](#main-goals)

- preserve simple usage as in version 1.X.X
- use of PDO
- less methods better maintability
- compatibility from PHP 7.4 - 8.3

Installation with composer
--------------------------

[](#installation-with-composer)

### With composer

[](#with-composer)

Add the package to your composer.json file

```
"require":
{

        "pjanisio/simpledb": "^2.4"
}

```

Example of raw SQL statement execution
--------------------------------------

[](#example-of-raw-sql-statement-execution)

```
// Example: Using the execute method to run a raw SQL statement
    $sql = "UPDATE `users` SET `email` = 'john.doe@example.com' WHERE `username` = 'john_doe'";
    $stmt = $db->execute($sql);

    echo "Number of affected rows: " . $db->rowCount($stmt) . "\n";
```

Example usage (all basic methods)
---------------------------------

[](#example-usage-all-basic-methods)

```
