PHPackages                             raywill/pdo - 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. raywill/pdo

ActiveLibrary

raywill/pdo
===========

an easy to use mysql pdo wrapper extracted from we7

v0.2(6y ago)05MITPHP

Since Apr 26Pushed 6y agoCompare

[ Source](https://github.com/raywill/pdo)[ Packagist](https://packagist.org/packages/raywill/pdo)[ RSS](/packages/raywill-pdo/feed)WikiDiscussions master Synced 1w ago

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

使用方法
----

[](#使用方法)

```
use raywill\pdo\Pdo;
$db = new Pdo('localhost','root','111','3306','tp','oauth_');//主机地址,数据库帐号,密码,端口,表名,表前缀
var_dump($db->get('users'));//查询一条数据
$db->debug();//显示调试语句

```

更多介绍
----

[](#更多介绍)

```
表名
$db->tablename('mc_members')
查询一条数据
$db->get('yoby_demo',['id'=>1]);
$db->get('yoby_demo',['id'=>1],['title','num']);返回特定字段
$db->get('yoby_demo',[],['count(*) as z','title','num','max(num)']);
$db->fetch("SELECT username, uid FROM ".tablename('users')." WHERE uid = :uid LIMIT 1", array(':uid' => 1));
查询单字段
$db->getcolumn('yoby_demo',['id'=>1],'title');
$db->fetchcolumn("SELECT COUNT(*) FROM ".tablename('users'));
查询多条记录
表名,条件,返回字段,主键,排序,限制条数
$db->getall('yoby_demo',[],[],'','id desc','LIMIT '.($pindex-1)* $psize.','.$psize);
$db->fetchall("SELECT username, uid FROM ".tablename('users'), []);
插入数据,第二个参数数组
$db->insert('yoby_demo',[]);
$id = $db->insertid();插入id
修改
$db->update('yoby_demo',['num +='=>1],['id'=>1]);
删除
$db->delete('yoby_demo',['id'=>1]);
执行sql
$db->query("DELETE FROM ".tablename('users')." WHERE uid = :uid", array(':uid' => 2));
支持多条sql用分号隔开
$db->run($sql);
显示调试语句
$db->debug();
检测某个字段是否存在
$db->fieldexists('shopping_goods', 'credit');
检测某个表是否存在
$db->tableexists($tablename)
检测表是否为空
$db->exists($tb)
获取数据条数
$db->count($tb,['id'=>1])

```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 64.7% 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 ~0 days

Total

2

Last Release

2213d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fe05a1ef897c7728cc07bc2de77f75192083d68dc26da316bf9d8ed4e6d0296f?d=identicon)[raywill](/maintainers/raywill)

---

Top Contributors

[![logoove](https://avatars.githubusercontent.com/u/1687564?v=4)](https://github.com/logoove "logoove (11 commits)")[![raywill](https://avatars.githubusercontent.com/u/248295?v=4)](https://github.com/raywill "raywill (6 commits)")

### Embed Badge

![Health badge](/badges/raywill-pdo/health.svg)

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

PHPackages © 2026

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