當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Database::exec方法代碼示例

本文整理匯總了PHP中core\Database::exec方法的典型用法代碼示例。如果您正苦於以下問題:PHP Database::exec方法的具體用法?PHP Database::exec怎麽用?PHP Database::exec使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在core\Database的用法示例。


在下文中一共展示了Database::exec方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: clearTables

 private static function clearTables(\Core\Database $db)
 {
     $clearScript = new \Helpers\TablesClearScript();
     foreach ($clearScript as $statement) {
         $db->exec($statement, array());
     }
 }
開發者ID:anddorua,項目名稱:boardroom,代碼行數:7,代碼來源:BookControllerTest.php

示例2: makeUpdateQuery

 protected function makeUpdateQuery($table_name, $fields_to_save, array $where_condition, \Core\Database $db)
 {
     $value_equation_list_imploded = $this->makeEquationString(',', $fields_to_save);
     $value_list = $this->makeValueVarArray($fields_to_save);
     $sql = "update {$table_name} set {$value_equation_list_imploded} where " . $this->makeEquationString(' and ', $where_condition);
     $value_list = array_merge($value_list, $this->makeValueVarArray($where_condition));
     //error_log("\nSQL:" . print_r($sql, true) . "\nvalues:" . print_r($value_list, true), 3, "my_errors.txt");
     return $db->exec($sql, $value_list);
 }
開發者ID:anddorua,項目名稱:boardroom,代碼行數:9,代碼來源:ObjectMapper.php

示例3: deleteById

 public function deleteById($appId, \Core\Database $db)
 {
     $sql = 'delete from appointments where id=:id';
     $db->exec($sql, array(':id' => $appId));
 }
開發者ID:anddorua,項目名稱:boardroom,代碼行數:5,代碼來源:AppointmentItem.php

示例4: remove

 public function remove($empId, \Core\Database $db)
 {
     $sql = "delete from employees where id=:id";
     $db->exec($sql, array("id" => $empId));
 }
開發者ID:anddorua,項目名稱:boardroom,代碼行數:5,代碼來源:EmpItem.php


注:本文中的core\Database::exec方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。