diff options
author | Andrey Hristov <andrey@php.net> | 2014-02-25 17:39:06 +0200 |
---|---|---|
committer | Andrey Hristov <andrey@php.net> | 2014-02-25 17:39:06 +0200 |
commit | aad7b724721c01f6269951511ee4c92843f56e0c (patch) | |
tree | 8e30261d24a3595fbe5f1c195276806642fe275d | |
parent | 60ed3f78bdab82b21c67b12ecd31ff7fd710e4f2 (diff) | |
download | php-git-aad7b724721c01f6269951511ee4c92843f56e0c.tar.gz |
Use API instead of directly acessing the structure
-rw-r--r-- | ext/mysqli/mysqli_prop.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/mysqli/mysqli_prop.c b/ext/mysqli/mysqli_prop.c index 7060367394..2d36336372 100644 --- a/ext/mysqli/mysqli_prop.c +++ b/ext/mysqli/mysqli_prop.c @@ -311,19 +311,21 @@ static int result_lengths_read(mysqli_object *obj, zval **retval TSRMLS_DC) { MYSQL_RES *p; ulong *ret; + uint field_count; MAKE_STD_ZVAL(*retval); CHECK_STATUS(MYSQLI_STATUS_VALID); p = (MYSQL_RES *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr; - if (!p || !p->field_count || !(ret = mysql_fetch_lengths(p))) { + field_count = mysql_num_fields(p); + if (!p || !field_count || !(ret = mysql_fetch_lengths(p))) { ZVAL_NULL(*retval); } else { ulong i; array_init(*retval); - for (i = 0; i < p->field_count; i++) { + for (i = 0; i < field_count; i++) { add_index_long(*retval, i, ret[i]); } } |