Skip to content

Instantly share code, notes, and snippets.

@cmb69 cmb69/clear-before-bind.patch Secret
Created Nov 12, 2018

Embed
What would you like to do?
Clear bindings before (re-)binding
ext/sqlite3/sqlite3.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/ext/sqlite3/sqlite3.c b/ext/sqlite3/sqlite3.c
index 2c269fc337..7da20ef49a 100644
--- a/ext/sqlite3/sqlite3.c
+++ b/ext/sqlite3/sqlite3.c
@@ -1565,6 +1565,7 @@ PHP_METHOD(sqlite3stmt, execute)
SQLITE3_CHECK_INITIALIZED(stmt_obj->db_obj, stmt_obj->initialised, SQLite3);
if (stmt_obj->bound_params) {
+ sqlite3_clear_bindings(stmt_obj->stmt);
ZEND_HASH_FOREACH_PTR(stmt_obj->bound_params, param) {
zval *parameter;
/* parameter must be a reference? */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.