diff options
| author | Mark Newnham <mark@newnhams.com> | 2022-06-02 15:01:00 -0600 |
|---|---|---|
| committer | Damien Regad <dregad@mantisbt.org> | 2022-06-08 11:17:53 +0200 |
| commit | 4d2baa2dc20569991bcf03bb72b8e03f9a6923d6 (patch) | |
| tree | c0279fb5ca4f7fef4ebfa205fc4ac00e27573075 | |
| parent | 2b608cdd804a549ee6256f4ab681e421868eafc2 (diff) | |
| download | adodb-4d2baa2dc20569991bcf03bb72b8e03f9a6923d6.tar.gz adodb-4d2baa2dc20569991bcf03bb72b8e03f9a6923d6.tar.bz2 adodb-4d2baa2dc20569991bcf03bb72b8e03f9a6923d6.zip | |
mysql: fix regression with portable bind arrays
The fix for issue #806 introduced a regression causing all bound SQL
statements to fail in the mysqli driver, when using alphanumeric
placeholders.
To fix the problem, we ensure that bind array passed to mysqli bind
function is numeric.
Fixes #838
Signed-off-by: Damien Regad <dregad@mantisbt.org>
Changes to original commit: fixed coding guidelines, improved message.
| -rw-r--r-- | drivers/adodb-mysqli.inc.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/adodb-mysqli.inc.php b/drivers/adodb-mysqli.inc.php index 0100e7f8..bd5b3c34 100644 --- a/drivers/adodb-mysqli.inc.php +++ b/drivers/adodb-mysqli.inc.php @@ -1119,6 +1119,10 @@ class ADODB_mysqli extends ADOConnection { if (!is_array($inputarr)) { $inputarr = array($inputarr); } + else { + //remove alphanumeric placeholders + $inputarr = array_values($inputarr); + } if (!is_array($sql)) { // Check if we are bulkbinding. If so, $inputarr is a 2d array, |
