PHPackages                             kevensuu/php-mysql-pdo-driver-class - 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. kevensuu/php-mysql-pdo-driver-class

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

kevensuu/php-mysql-pdo-driver-class
===================================

php-mysql-pdo-driver-class

07PHP

Since Sep 23Pushed 9y ago1 watchersCompare

[ Source](https://github.com/kevensuu/php-mysql-pdo-driver-class)[ Packagist](https://packagist.org/packages/kevensuu/php-mysql-pdo-driver-class)[ RSS](/packages/kevensuu-php-mysql-pdo-driver-class/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

\#Mysql PDO 操作类

### 数据库配置文件 data.ini

[](#数据库配置文件-dataini)

```
[default]
database = mysql
host = 127.0.0.1
port = 3306
username = root
password =
dbname = test

[user]
database = mysql
host = 127.0.0.1
port = 3306
username = root
password =
dbname = user

```

可以配置多个数据库，选择数据方式:

```
$obj = new Db_mysql_pdo('default');
$obj = new Db_mysql_pdo('user');

```

### PDO操作类 Db\_mysql\_pdo

[](#pdo操作类-db_mysql_pdo)

##### 获取PDO对象

[](#获取pdo对象)

```
$pdo = new Db_mysql_pdo();

```

##### 执行一条SQL语句

[](#执行一条sql语句)

```
$pdo = new Db_mysql_pdo();
$pdo->queryquery($sql, $parameters = array(), $fetchmode = PDO::FETCH_ASSOC);

```

由于个人比较偏爱写原生的select SQL，所以没有封装关于select的方法

##### 插入一条记录

[](#插入一条记录)

```
$pdo = new Db_mysql_pdo();
$pdo->insert($tableName, array $data);

```

##### 插入多条记录

[](#插入多条记录)

```
$pdo = new Db_mysql_pdo();
$pdo->insertBatch($tableName, array $data);

```

##### 获取插入的最后ID值

[](#获取插入的最后id值)

```
$pdo = new Db_mysql_pdo();
$pdo->lastInsertId();

```

##### 更新

[](#更新)

```
$pdo = new Db_mysql_pdo();
$pdo->update($tableName, array $where, array $data, array $other=array());

```

##### 删除

[](#删除)

```
$pdo = new Db_mysql_pdo();
$pdo->delete($tableName, array $where, array $other=array());

```

持续更新中......

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 57.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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/8a4de14e08a4f29f7512dfe79a2fe4eaefaecd88709e309069e9aec6cab06833?d=identicon)[kevensuu](/maintainers/kevensuu)

---

Top Contributors

[![kevensuu](https://avatars.githubusercontent.com/u/16250692?v=4)](https://github.com/kevensuu "kevensuu (12 commits)")[![sumiaowen](https://avatars.githubusercontent.com/u/4075541?v=4)](https://github.com/sumiaowen "sumiaowen (9 commits)")

### Embed Badge

![Health badge](/badges/kevensuu-php-mysql-pdo-driver-class/health.svg)

```
[![Health](https://phpackages.com/badges/kevensuu-php-mysql-pdo-driver-class/health.svg)](https://phpackages.com/packages/kevensuu-php-mysql-pdo-driver-class)
```

###  Alternatives

[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k116.5M113](/packages/jdorn-sql-formatter)[propel/propel1

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

8351.6M87](/packages/propel-propel1)[pgvector/pgvector

pgvector support for PHP

198628.3k10](/packages/pgvector-pgvector)

PHPackages © 2026

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