diff --git a/reference/mysqli/mysqli_result/fetch-array.xml b/reference/mysqli/mysqli_result/fetch-array.xml index db65bc9d22..6630be4a35 100644 --- a/reference/mysqli/mysqli_result/fetch-array.xml +++ b/reference/mysqli/mysqli_result/fetch-array.xml @@ -29,14 +29,14 @@ this function can also store the data in associative indices by using the field names of the result set as keys. - &database.field-case; - &database.fetch-null; - If two or more columns of the result have the same field names, the last - column will take precedence and overwrite the earlier data. In order to + If two or more columns of the result have the same name, the last + column will take precedence and overwrite any previous data. To access multiple columns with the same name, the numerically indexed version of the row must be used. + &database.field-case; + &database.fetch-null; diff --git a/reference/mysqli/mysqli_result/fetch-assoc.xml b/reference/mysqli/mysqli_result/fetch-assoc.xml index aa710769c0..ef453e0ef2 100644 --- a/reference/mysqli/mysqli_result/fetch-assoc.xml +++ b/reference/mysqli/mysqli_result/fetch-assoc.xml @@ -23,6 +23,14 @@ Returns an associative array that corresponds to the fetched row or &null; if there are no more rows. + + If two or more columns of the result have the same name, the last + column will take precedence and overwrite any previous data. To + access multiple columns with the same name, + mysqli_fetch_row may be used to fetch the numerically + indexed array, or aliases may be used in the SQL query select list to give + columns different names. + &database.field-case; &database.fetch-null; @@ -39,16 +47,10 @@ &reftitle.returnvalues; - Returns an associative array of values representing the fetched row in the result + Returns an associative array representing the fetched row in the result set, where each key in the array represents the name of one of the result set's columns or &null; if there are no more rows in result set. - - If two or more columns of the result have the same field names, the last - column will take precedence. To access the other column(s) of the same - name, you either need to access the result with numeric indices by using - mysqli_fetch_row or add alias names. - @@ -105,7 +107,7 @@ Santa Clara (USA) Comparison of <classname>mysqli_result</classname> <classname>iterator</classname> and <methodname>mysqli_result::fetch_assoc</methodname> usage - mysqli_result can be iterated using &foreach;. + mysqli_result can be iterated using &foreach;. The result set will always be iterated from the first row, regardless of the current position. diff --git a/reference/mysqli/mysqli_result/fetch-object.xml b/reference/mysqli/mysqli_result/fetch-object.xml index 99819a1440..14cd9d832f 100644 --- a/reference/mysqli/mysqli_result/fetch-object.xml +++ b/reference/mysqli/mysqli_result/fetch-object.xml @@ -27,6 +27,14 @@ result set as an object where the attributes of the object represent the names of the fields found within the result set. + + If two or more columns of the result have the same name, the last + column will take precedence and overwrite any previous data. To + access multiple columns with the same name, + mysqli_fetch_row may be used to fetch the numerically + indexed array, or aliases may be used in the SQL query select list to give + columns different names. + This function sets the properties @@ -67,8 +75,9 @@ &reftitle.returnvalues; - Returns an object that corresponds to the fetched - row or &null; if there are no more rows in result set. + Returns an object representing the fetched row, where each property + represents the name of the result set's column, or &null; + if there are no more rows in the result set. diff --git a/reference/mysqli/mysqli_result/fetch-row.xml b/reference/mysqli/mysqli_result/fetch-row.xml index 005d644ac1..1307c96b29 100644 --- a/reference/mysqli/mysqli_result/fetch-row.xml +++ b/reference/mysqli/mysqli_result/fetch-row.xml @@ -40,7 +40,7 @@ &reftitle.returnvalues; - mysqli_fetch_row returns an array of values that corresponds to the fetched row + mysqli_fetch_row returns an enumerated array representing the fetched row or &null; if there are no more rows in result set.