bindValue doesn't need the length
This commit is contained in:
parent
4f051fe5a5
commit
0cc2b67753
|
@ -395,7 +395,7 @@ class Database extends AbstractData
|
||||||
|
|
||||||
// create comment list
|
// create comment list
|
||||||
$comments = array();
|
$comments = array();
|
||||||
if (count($rows)) {
|
if (is_array($rows) && count($rows)) {
|
||||||
foreach ($rows as $row) {
|
foreach ($rows as $row) {
|
||||||
$i = $this->getOpenSlot($comments, (int) $row['postdate']);
|
$i = $this->getOpenSlot($comments, (int) $row['postdate']);
|
||||||
$data = Json::decode($row['data']);
|
$data = Json::decode($row['data']);
|
||||||
|
@ -527,7 +527,7 @@ class Database extends AbstractData
|
||||||
(self::$_type === 'oci' ? 'FETCH NEXT ? ROWS ONLY' : 'LIMIT ?'),
|
(self::$_type === 'oci' ? 'FETCH NEXT ? ROWS ONLY' : 'LIMIT ?'),
|
||||||
array(time(), 0, $batchsize)
|
array(time(), 0, $batchsize)
|
||||||
);
|
);
|
||||||
if (count($rows)) {
|
if (is_array($rows) && count($rows)) {
|
||||||
foreach ($rows as $row) {
|
foreach ($rows as $row) {
|
||||||
$pastes[] = $row['dataid'];
|
$pastes[] = $row['dataid'];
|
||||||
}
|
}
|
||||||
|
@ -554,8 +554,6 @@ class Database extends AbstractData
|
||||||
$position = $key + 1;
|
$position = $key + 1;
|
||||||
if (is_int($parameter)) {
|
if (is_int($parameter)) {
|
||||||
$statement->bindValue($position, $parameter, PDO::PARAM_INT);
|
$statement->bindValue($position, $parameter, PDO::PARAM_INT);
|
||||||
} elseif ($length = strlen($parameter) >= 4000) {
|
|
||||||
$statement->bindValue($position, $parameter, PDO::PARAM_STR, $length);
|
|
||||||
} else {
|
} else {
|
||||||
$statement->bindValue($position, $parameter);
|
$statement->bindValue($position, $parameter);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue