diff --git a/reference/mysqli/mysqli_stmt/result-metadata.xml b/reference/mysqli/mysqli_stmt/result-metadata.xml index 2b91153957d1..724df29fb758 100644 --- a/reference/mysqli/mysqli_stmt/result-metadata.xml +++ b/reference/mysqli/mysqli_stmt/result-metadata.xml @@ -25,8 +25,15 @@ that can be used to process the meta information such as total number of fields and individual field information. + + This function returns an empty mysqli_result object + which can be used to access metadata information from the prepared statement + without having to fetch the actual rows of data. There is no need to use + this function when using mysqli_stmt_get_result to + retrieve the entire result set from a prepared statement as a result object. + - This result set pointer can be passed as an argument to any of the + This result set object can be passed as an argument only to the field-based functions that process result set metadata, such as: mysqli_num_fields @@ -40,15 +47,12 @@ - - The result set structure should be freed when you are done with it, - which you can do by passing it to mysqli_free_result - - The result set returned by mysqli_stmt_result_metadata contains only - metadata. It does not contain any row results. The rows are obtained by using the - statement handle with mysqli_stmt_fetch. + The result set returned by mysqli_stmt_result_metadata + contains only metadata. It does not contain any row results. + The rows are obtained by calling mysqli_stmt_get_result + on the statement handle or with mysqli_stmt_fetch. @@ -66,6 +70,7 @@ &reftitle.returnvalues; Returns a result object or &false; if an error occurred. + If the statement does not produce a result set, &false; is returned as well. @@ -98,12 +103,6 @@ $result = $stmt->result_metadata(); $field = $result->fetch_field(); printf("Fieldname: %s\n", $field->name); - -/* close resultset */ -$result->close(); - -/* close connection */ -$mysqli->close(); ?> ]]> @@ -130,12 +129,6 @@ $result = mysqli_stmt_result_metadata($stmt); $field = mysqli_fetch_field($result); printf("Fieldname: %s\n", $field->name); - -/* close resultset */ -mysqli_free_result($result); - -/* close connection */ -mysqli_close($link); ?> ]]> @@ -148,6 +141,7 @@ mysqli_close($link); mysqli_prepare mysqli_free_result + mysqli_stmt_get_result