首 页 ASP ASP.NET PHP JSP Ajax DIV+CSS JavaScript XML C#
MySQL MSSQL Access Oracle Linux Server 电脑技巧 网络安全 建站经验 其它

PHP5 OOP编程中的代理与异常

整理日期:2008年08月10日 【字体:


伊图教程网[www.etoow.com]
http://www.etoow.com/html/2008-08/1218328962.html
class DBQuery
{
 .....

 public function fetch_array()
 { 
  if (! is_resource($this->result)) {
   throw new Exception('Query not executed.');
  }

  return $this->db->fetch_array($this->result);
 }

 public function fetch_row()
 {
  if (! is_resource($this->result)) {
   throw new Exception('Query not executed.');
  }

  return $this->db->fetch_row($this->result);
 }

 public function fetch_assoc()
 {
  if (! is_resource($this->result)) {
   throw new Exception('Query not executed.');
  }

  return $this->db->fetch_assoc($this->result);
 }

 public function fetch_object()
 {
  if (! is_resource($this->result)) {
   throw new Exception('Query not executed.');
  }

  return $this->db->fetch_object($this->result);
 }
Tags:
PHP5 OOP编程中的代理与异常
'http://www.etoow.com/html/2008-08/1218328962.html
1
 
234
信息搜索
  
联系我们关于本站广告服务设为首页 收藏本站友情链接网站地图
Copyright © Etoow.com Inc. All Rights Reserved