当前位置: 首页>>代码示例>>PHP>>正文


PHP db_factory::factory方法代码示例

本文整理汇总了PHP中db_factory::factory方法的典型用法代码示例。如果您正苦于以下问题:PHP db_factory::factory方法的具体用法?PHP db_factory::factory怎么用?PHP db_factory::factory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在db_factory的用法示例。


在下文中一共展示了db_factory::factory方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getpaginateddata

 public function getpaginateddata($position)
 {
     $connection = db_factory::factory(DB_TYPE);
     $sql = "SELECT id,name,message FROM PaginateDao ORDER BY id DESC LIMIT {$position} ," . ITEM_PER_PAGE;
     $results = $connection->getArray($sql);
     $this->populate($results, 'paginate');
 }
开发者ID:andela-bmakinwa,项目名称:php_cnv_framework,代码行数:7,代码来源:paginatecollection.php

示例2: getwithdata

 public function getwithdata()
 {
     $connection = db_factory::factory(DB_TYPE);
     $sql = "select * from userdao order by username";
     $results = $connection->getArray($sql);
     $this->populate($results, 'user');
 }
开发者ID:andela-bmakinwa,项目名称:php_cnv_framework,代码行数:7,代码来源:userscollection.php

示例3: index

 public function index()
 {
     $connection = db_factory::factory(DB_TYPE);
     $sql = "SELECT COUNT(*) as num FROM PaginateDao";
     $result = $connection->getArray($sql);
     $pages = ceil((int) $result[0]['num'] / ITEM_PER_PAGE);
     return $pages;
 }
开发者ID:andela-bmakinwa,项目名称:php_cnv_framework,代码行数:8,代码来源:paginate_model.php

示例4: deleteuser

 public function deleteuser($user_id)
 {
     $connection = db_factory::factory(DB_TYPE);
     $sql = "DELETE FROM {$this->table} WHERE id = {$user_id}";
     if ($connection->execute($sql)) {
         return "<h4>Delete Failed</h4>";
     } else {
         return "<h4>Delete Successful</h4> ";
     }
 }
开发者ID:andela-bmakinwa,项目名称:php_cnv_framework,代码行数:10,代码来源:user_model.php

示例5: update

 protected function update()
 {
     $connection = db_factory::factory(DB_TYPE);
     $sql = "update {$this->table} set ";
     $updates = array();
     foreach ($this->values as $key => $value) {
         $updates[] = "`{$key}`='" . $connection->clean($value) . "'";
     }
     $sql .= implode(',', $updates);
     $sql .= "where id={$this->id}";
     $connection->execute($sql);
 }
开发者ID:andela-bmakinwa,项目名称:php_cnv_framework,代码行数:12,代码来源:dao.php


注:本文中的db_factory::factory方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。