stick to single convention of binding parameters

This commit is contained in:
El RIDO 2022-01-24 17:26:09 +01:00
parent 0cc2b67753
commit a8e1c33b54
No known key found for this signature in database
GPG Key ID: 0F5C940A6BD81F92
1 changed files with 7 additions and 12 deletions

View File

@ -548,20 +548,15 @@ class Database extends AbstractData
private static function _exec($sql, array $params)
{
$statement = self::$_db->prepare($sql);
if (self::$_type === 'oci') {
// It is not possible to execute in the normal way if strlen($param) >= 4000
foreach ($params as $key => $parameter) {
$position = $key + 1;
if (is_int($parameter)) {
$statement->bindValue($position, $parameter, PDO::PARAM_INT);
} else {
$statement->bindValue($position, $parameter);
}
foreach ($params as $key => $parameter) {
$position = $key + 1;
if (is_int($parameter)) {
$statement->bindValue($position, $parameter, PDO::PARAM_INT);
} else {
$statement->bindValue($position, $parameter);
}
$result = $statement->execute();
} else {
$result = $statement->execute($params);
}
$result = $statement->execute();
$statement->closeCursor();
return $result;
}