本文整理汇总了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));
}