當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。