From: George Schlossnagle Date: Tue, 18 May 2004 20:26:24 +0000 (+0000) Subject: support the read-only property 'queryString' X-Git-Tag: RELEASE_0_1~134 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5f4cfcb00962698edb4f47e02fe2092d7212aa64;p=php support the read-only property 'queryString' --- 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; }