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;