From: Georg Richter Date: Tue, 27 Jan 2004 13:56:03 +0000 (+0000) Subject: changed prototype mysql_dataseek from void to bool X-Git-Tag: php-5.0.0b4RC1~277 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=692726cdd3cad057a4f2d2fb5369c300b3da4c54;p=php changed prototype mysql_dataseek from void to bool add check for specified offset --- 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; } /* }}} */