readability

This commit is contained in:
El RIDO 2022-01-26 05:28:29 +01:00
parent 53c0e4976b
commit 1d20eee169
No known key found for this signature in database
GPG key ID: 0F5C940A6BD81F92

View file

@ -549,12 +549,13 @@ class Database extends AbstractData
{ {
$statement = self::$_db->prepare($sql); $statement = self::$_db->prepare($sql);
foreach ($params as $key => &$parameter) { foreach ($params as $key => &$parameter) {
$position = $key + 1;
if (is_int($parameter)) { if (is_int($parameter)) {
$statement->bindParam($key + 1, $parameter, PDO::PARAM_INT); $statement->bindParam($position, $parameter, PDO::PARAM_INT);
} elseif (strlen($parameter) >= 4000) { } elseif (strlen($parameter) >= 4000) {
$statement->bindParam($key + 1, $parameter, PDO::PARAM_STR, strlen($parameter)); $statement->bindParam($position, $parameter, PDO::PARAM_STR, strlen($parameter));
} else { } else {
$statement->bindParam($key + 1, $parameter); $statement->bindParam($position, $parameter);
} }
} }
$result = $statement->execute(); $result = $statement->execute();