PHPackages                             easeappphp/pdolight - 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. easeappphp/pdolight

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

easeappphp/pdolight
===================

A very simple and safe PHP library to execute PDO based database queries. Methods are provided to prepare a SQL Statement &amp; it's execution separately as different methods (to facilitate caching of prepared statements) as well as together in a single method too.

1.0.9(2y ago)0781MITPHPPHP &gt;=8.1

Since Dec 27Pushed 2y ago1 watchersCompare

[ Source](https://github.com/easeappphp/PDOLight)[ Packagist](https://packagist.org/packages/easeappphp/pdolight)[ Docs](https://www.easeapp.org/)[ RSS](/packages/easeappphp-pdolight/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (10)DependenciesVersions (11)Used By (1)

PDOLight
========

[](#pdolight)

> A very simple and safe PHP library to execute PDO based database queries. Methods are provided to prepare a SQL Statement &amp; it's execution separately as different methods (to facilitate caching of prepared statements) as well as together in a single method too.

### Why PDOLight?

[](#why-pdolight)

Doing SQL Queries on MySQL/MariaDB in a simple and secure way, preventing SQL Injection is always an important thing. This library is kept simple so, queries can be written and values are provided as an associative array when making DB queries.

### Advantages

[](#advantages)

- Uses prepared statements
- MySQL/MariaDB Connection object supported at present
- Named parameters supported basically instead of question mark `"?"` placeholders
- While sanitizing inputs is always a good practice, values that are provided as input to `runPreparedQuery` or `executeQuery` methods serve the purpose by securely executing respective DB queries
- Have required checks to find database connection errors and to reconnect to the database when preparing db queries

### Getting started

[](#getting-started)

With Composer, run

```
composer require easeappphp/pdolight:^1.0.9
```

Note that the `vendor` folder and the `vendor/autoload.php` script are generated by Composer; they are not part of PDOLight.

To include the library,

```
