diff options
| author | Georg Richter <georg@php.net> | 2004-01-27 13:56:03 +0000 |
|---|---|---|
| committer | Georg Richter <georg@php.net> | 2004-01-27 13:56:03 +0000 |
| commit | 692726cdd3cad057a4f2d2fb5369c300b3da4c54 (patch) | |
| tree | a32cd4a7c992234d6bf1aa93555f1d163d854544 | |
| parent | 429aa55248838c7827ab41ae2ffe7749a7d2228d (diff) | |
| download | php-git-692726cdd3cad057a4f2d2fb5369c300b3da4c54.tar.gz | |
changed prototype mysql_dataseek from void to bool
add check for specified offset
| -rw-r--r-- | ext/mysqli/mysqli_api.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c index f0b30b2c4b..8282361bf2 100644 --- a/ext/mysqli/mysqli_api.c +++ b/ext/mysqli/mysqli_api.c @@ -420,7 +420,7 @@ PHP_FUNCTION(mysqli_commit) } /* }}} */ -/* {{{ proto void mysqli_data_seek(object result, int offset) +/* {{{ proto bool mysqli_data_seek(object result, int offset) Move internal result pointer */ PHP_FUNCTION(mysqli_data_seek) { @@ -436,11 +436,15 @@ PHP_FUNCTION(mysqli_data_seek) if (result->handle && result->handle->status == MYSQL_STATUS_USE_RESULT) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Function cannot be used with MYSQL_USE_RESULT"); - RETURN_LONG(0); + RETURN_FALSE; + } + + if (!offset || offset >= result->row_count) { + RETURN_FALSE; } mysql_data_seek(result, offset); - return; + RETURN_TRUE; } /* }}} */ |
