刚封装的一个PDO类


写自己框架时封装的一个PDO类,例子看test.php,MYSQLi的等等再说,别说PDO是已经封装好了的话,多种环境统一的代码风格很重要

代码:
<?php
update($table,$args,$condition);
print_r($db-&gt;fetAll('test',$condition = '',$sort = '',$limit = '5',$field = '*'));
print_r($db-&gt;fetOne('test',$condition = null,$field = '*'));
print_r($db-&gt;execute('update test set title="24234" where id=1'));
print_r($db-&gt;getRow('select count(*) from test'));*/
print_r($db-&gt;getOne('select * from test'));
print_r($db-&gt;getAll('select * from test1 limit 5'));
print_r($db-&gt;getFields('test'));
print_r($db-&gt;insert('test',array('title'=&gt;'insert test','test'=&gt;'123123')));
print_r($db-&gt;update('test',array('title'=&gt;'insert test111','test'=&gt;'123123'),array('id'=&gt;'2')));
print_r($db-&gt;delete('test',array('title'=&gt;'insert test')));
$db-&gt;close();?>

下载

  1. #1 by 老农 on 四月 14th, 2009

    好,这个类先抄下来再说。谢

  2. #2 by 劳力士 on 十一月 23rd, 2009

    好,谢谢 !

(will not be published)

  1. No trackbacks yet.