From 5f4cfcb00962698edb4f47e02fe2092d7212aa64 Mon Sep 17 00:00:00 2001 From: George Schlossnagle Date: Tue, 18 May 2004 20:26:24 +0000 Subject: [PATCH] support the read-only property 'queryString' --- ext/pdo/pdo_stmt.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index e9bf0b0d01..5bcb963ed1 100755 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -527,10 +527,19 @@ function_entry pdo_dbstmt_functions[] = { static zval *dbstmt_prop_read(zval *object, zval *member, int type TSRMLS_DC) { zval *return_value; + pdo_stmt_t * stmt = (pdo_stmt_t *) zend_object_store_get_object(object); + zval tmp_zv; - MAKE_STD_ZVAL(return_value); - ZVAL_NULL(return_value); + convert_to_string(member); + if(strncmp(Z_STRVAL_P(member), "queryString", sizeof("queryString")) == 0) { + MAKE_STD_ZVAL(return_value); + ZVAL_STRINGL(return_value, stmt->query_string, stmt->query_stringlen, 1); + } + else { + MAKE_STD_ZVAL(return_value); + ZVAL_NULL(return_value); + } return return_value; } -- 2.50.1