diff options
author | Georg Richter <georg@php.net> | 2004-01-25 12:01:36 +0000 |
---|---|---|
committer | Georg Richter <georg@php.net> | 2004-01-25 12:01:36 +0000 |
commit | a2380e901b72620541f15d7364484cc0c88d2e36 (patch) | |
tree | 21ef71b88228966be47e8c499f4bcec5095fb486 /ext | |
parent | 386310ea02ba08392174db7127a31d9a62336e96 (diff) | |
download | php-git-a2380e901b72620541f15d7364484cc0c88d2e36.tar.gz |
prototype fix for mysqli_fetch
Diffstat (limited to 'ext')
-rw-r--r-- | ext/mysqli/mysqli_api.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c index abe17b55ed..550e1bc9bf 100644 --- a/ext/mysqli/mysqli_api.c +++ b/ext/mysqli/mysqli_api.c @@ -628,7 +628,7 @@ PHP_FUNCTION(mysqli_execute) } /* }}} */ -/* {{{ proto int mysqli_fetch(object stmt) +/* {{{ proto mixed mysqli_fetch(object stmt) Fetch results from a prepared statement into the bound variables */ PHP_FUNCTION(mysqli_fetch) { @@ -670,7 +670,7 @@ PHP_FUNCTION(mysqli_fetch) if (lval != (long)lval) { /* even though lval is declared as unsigned, the value * may be negative. Therefor we cannot use %llu and must - * user %lld. + * use %lld. */ sprintf((char *)&tmp, "%lld", lval); ZVAL_STRING(stmt->result.vars[i], tmp, 1); @@ -695,7 +695,17 @@ PHP_FUNCTION(mysqli_fetch) MYSQLI_REPORT_STMT_ERROR(stmt->stmt); } - RETURN_LONG(ret); + switch (ret) { + case 0: + RETURN_TRUE; + break; + case 1: + RETURN_FALSE; + break; + default: + RETURN_LONG(ret); + break; + } } /* }}} */ @@ -861,7 +871,7 @@ PHP_FUNCTION(mysqli_field_count) } /* }}} */ -/* {{{ proto int mysqli_field_seek(object link, int fieldnr) +/* {{{ proto int mysqli_field_seek(object result, int fieldnr) Set result pointer to a specified field offset */ PHP_FUNCTION(mysqli_field_seek) |