From 471da9b005545cf75b228cff04e684f54745842a Mon Sep 17 00:00:00 2001 From: yitam Date: Fri, 10 Feb 2017 13:21:53 -0800 Subject: [PATCH] Fix issue #35 --- source/pdo_sqlsrv/pdo_stmt.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/pdo_sqlsrv/pdo_stmt.cpp b/source/pdo_sqlsrv/pdo_stmt.cpp index d8b086a7..6adfbd0c 100644 --- a/source/pdo_sqlsrv/pdo_stmt.cpp +++ b/source/pdo_sqlsrv/pdo_stmt.cpp @@ -738,6 +738,10 @@ int pdo_sqlsrv_stmt_get_col_data(pdo_stmt_t *stmt, int colno, pdo_bound_param_data* bind_data = NULL; bind_data = reinterpret_cast(zend_hash_index_find_ptr(stmt->bound_columns, colno)); + if (bind_data == NULL) { + // can't find by index then try searching by name + bind_data = reinterpret_cast(zend_hash_find_ptr(stmt->bound_columns, stmt->columns[colno].name)); + } if( bind_data != NULL && !Z_ISUNDEF(bind_data->driver_params) ) {