Skip to content

Commit 243d14f

Browse files
committed
Fix error messages
1 parent 92c26ae commit 243d14f

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

ext/mysqli/mysqli_nonapi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,8 +453,8 @@ PHP_FUNCTION(mysqli_fetch_column)
453453
zend_argument_value_error(ERROR_ARG_POS(2), "must be greater than or equal to 0");
454454
RETURN_THROWS();
455455
}
456-
if(col_no >= result->field_count) {
457-
zend_value_error("Invalid column index");
456+
if (col_no >= mysql_num_fields(result)) {
457+
zend_argument_value_error(ERROR_ARG_POS(2), "must be less than the number of fields for this result set");
458458
RETURN_THROWS();
459459
}
460460

ext/mysqli/tests/mysqli_class_mysqli_result_interface.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ require_once('skipifconnectfailure.inc');
3535
'fetch_fields' => true,
3636
'fetch_object' => true,
3737
'fetch_row' => true,
38+
'fetch_column' => true,
3839
'field_seek' => true,
3940
'free' => true,
4041
'free_result' => true,

ext/mysqli/tests/mysqli_fetch_column.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ int(1)
121121
[008]
122122
mysqli_fetch_column(): Argument #2 ($column) must be greater than or equal to 0
123123
[009]
124-
Invalid column index
124+
mysqli_fetch_column(): Argument #2 ($column) must be less than the number of fields for this result set
125125
mysqli_result object is already closed
126126
[010]
127127
int(1)

0 commit comments

Comments
 (0)