Skip to content

Instantly share code, notes, and snippets.

@cmb69
Created November 12, 2018 12:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cmb69/1c41991df75f307a760ae473a2e9345b to your computer and use it in GitHub Desktop.
Save cmb69/1c41991df75f307a760ae473a2e9345b to your computer and use it in GitHub Desktop.
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