Archive for 四月, 2009
PHP企业级应用之WebService篇
企业级应用,主要是讲PHP5对webservice的一些实现(以下的程序可以被JAVA,NET,C等正常调用)
国内用PHP写WebService的真的很少,网上资料也没多少,公司的项目开发过程中,经历了不少这方面的东西,写出来以供大家参考(谢谢老农提供的WSDL和程序文件)
客户端
Read the rest of this entry »
刚封装的一个PDO类
写自己框架时封装的一个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();?>