本文整理匯總了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());
}
}
示例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);
}
示例3: deleteById
public function deleteById($appId, \Core\Database $db)
{
$sql = 'delete from appointments where id=:id';
$db->exec($sql, array(':id' => $appId));
}
示例4: remove
public function remove($empId, \Core\Database $db)
{
$sql = "delete from employees where id=:id";
$db->exec($sql, array("id" => $empId));
}