public function affected_rows_count($_sql, $data = array())
{
try {
$stmt = $this->prepare($_sql);
if (!empty($data)) {
foreach (array_keys($data) as $key) {
$stmt->bindParam(':' . $key, $data[$key], PDO::PARAM_STR, strlen($data[$key]));
}
}
$stmt->execute();
return $stmt->rowCount();
} catch (PDOException $e) {
trigger_error($e->getMessage());
}
return false;
}