From: Nicolas Boisselier Date: Fri, 11 Oct 2024 09:08:10 +0000 (+0200) Subject: bindParam maxLength not null X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=491ab229c60171b755213587bc8053ec52ab102d;p=nb.git bindParam maxLength not null --- diff --git a/lib/php/db/field.php b/lib/php/db/field.php index 139403fe..bbd701b7 100644 --- a/lib/php/db/field.php +++ b/lib/php/db/field.php @@ -387,7 +387,10 @@ return false; $value = strval($value); return $sth->bindParam($name, $value, PDO::PARAM_STR); } - return $sth->bindParam($name, $value, $this->type2pdo($this->type), $this->size()); + $size = $this->size(); + # Passing null to parameter #4 ($maxLength) of type int is deprecatedassing null to parameter #4 ($maxLength) of type int is deprecated + if ($size === null) $size = 0; + return $sth->bindParam($name, $value, $this->type2pdo($this->type), $size); // NB 27.07.15 return $sth->bindParam($name, $value, $this->type2pdo($value)); }