写自己框架时封装的一个PDO类,例子看test.php,MYSQLi的等等再说,别说PDO是已经封装好了的话,多种环境统一的代码风格很重要
代码:
<?php
update($table,$args,$condition);
print_r($db->fetAll('test',$condition = '',$sort = '',$limit = '5',$field = '*'));
print_r($db->fetOne('test',$condition = null,$field = '*'));
print_r($db->execute('update test set title="24234" where id=1'));
print_r($db->getRow('select count(*) from test'));*/
print_r($db->getOne('select * from test'));
print_r($db->getAll('select * from test1 limit 5'));
print_r($db->getFields('test'));
print_r($db->insert('test',array('title'=>'insert test','test'=>'123123')));
print_r($db->update('test',array('title'=>'insert test111','test'=>'123123'),array('id'=>'2')));
print_r($db->delete('test',array('title'=>'insert test')));
$db->close();?>
#1 by 老农 on 四月 14th, 2009
好,这个类先抄下来再说。谢
#2 by 劳力士 on 十一月 23rd, 2009
好,谢谢 !