summaryrefslogtreecommitdiff
path: root/ext/mysqli/mysqli_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/mysqli/mysqli_api.c')
-rw-r--r--ext/mysqli/mysqli_api.c10
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;
}
/* }}} */