From d612253c1de7699f061bc92b33ec4fe290b4055f Mon Sep 17 00:00:00 2001 From: Jephte Clain Date: Fri, 7 Jun 2024 18:55:08 +0400 Subject: [PATCH] modifs.mineures sans commentaires --- src/db/_private/_base.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/db/_private/_base.php b/src/db/_private/_base.php index df634a1..ef4297c 100644 --- a/src/db/_private/_base.php +++ b/src/db/_private/_base.php @@ -64,10 +64,11 @@ abstract class _base { } else { ## associatif # paramètre + $param0 = preg_replace('/^.+\./', "", $key); $i = false; - if ($bindings !== null && array_key_exists($key, $bindings)) { + if ($bindings !== null && array_key_exists($param0, $bindings)) { $i = 2; - while (array_key_exists("$key$i", $bindings)) { + while (array_key_exists("$param0$i", $bindings)) { $i++; } } @@ -153,14 +154,14 @@ abstract class _base { $parts[] = $key; $parts[] = " $op "; } - $param = "$key$i"; + $param = "$param0$i"; $parts[] = ":$param"; $bindings[$param] = $value; if ($i === false) $i = 2; else $i++; } } else { - $param = "$key$i"; + $param = "$param0$i"; $parts[] = ":$param"; $bindings[$param] = $condvalue; if ($i === false) $i = 2; @@ -199,13 +200,13 @@ abstract class _base { } else { ## associatif # paramètre - $param = $key; - if ($bindings !== null && array_key_exists($param, $bindings)) { + $param = $param0 = preg_replace('/^.+\./', "", $key); + if ($bindings !== null && array_key_exists($param0, $bindings)) { $i = 2; - while (array_key_exists("$key$i", $bindings)) { + while (array_key_exists("$param0$i", $bindings)) { $i++; } - $param = "$key$i"; + $param = "$param0$i"; } # value $value = $part;