diff options
author | Georg Richter <georg@php.net> | 2003-04-03 08:03:59 +0000 |
---|---|---|
committer | Georg Richter <georg@php.net> | 2003-04-03 08:03:59 +0000 |
commit | 05e02eb27bebace6075407c148eb6f10cb0ea78f (patch) | |
tree | e06ace5dc10c37c1bca2229c12b734158acbe96f | |
parent | 130860e7092363a50711bf2166a67bd4520831ff (diff) | |
download | php-git-05e02eb27bebace6075407c148eb6f10cb0ea78f.tar.gz |
fixed mysqli_prepare_result
-rw-r--r-- | ext/mysqli/mysqli_api.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c index 323279022b..fa1aed7474 100644 --- a/ext/mysqli/mysqli_api.c +++ b/ext/mysqli/mysqli_api.c @@ -1342,10 +1342,11 @@ PHP_FUNCTION(mysqli_prepare) */ PHP_FUNCTION(mysqli_prepare_result) { - STMT *stmt; - MYSQL_RES *result; - zval *mysql_stmt; - PR_STMT *prstmt; + STMT *stmt; + MYSQL_RES *result; + zval *mysql_stmt; + PR_STMT *prstmt = NULL; + MYSQLI_RESOURCE *mysqli_resource; if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) { return; @@ -1356,7 +1357,10 @@ PHP_FUNCTION(mysqli_prepare_result) RETURN_FALSE; } - MYSQLI_RETURN_RESOURCE(result, mysqli_result_class_entry); + mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, sizeof(MYSQLI_RESOURCE)); + mysqli_resource->ptr = (void *)result; + mysqli_resource->prinfo = (void *)prstmt; + MYSQLI_RETURN_RESOURCE(mysqli_resource, mysqli_result_class_entry); } /* }}} */ |