: This article mainly introduces the mysqli_result class-member method. if you are interested in the PHP Tutorial, refer to it. Mysqli_result class -- Member method
Close () releases the inner and closes the result set. once the result set is called, it cannot be used again.
Data_seek () explicitly changes the record sequence of the current result
Fetch_field () obtains information about a field from the result set.
Fetch_fields () obtains information about all fields from the result set.
Fetch_field_direct () obtains the class details from a specified column and returns an object containing the column information.
Fetch_array () returns a result record in two forms: a common index array and an associated array.
Fetch_assoc () returns a result record in the form of a common joined array.
Fetch_object () returns a result record as an object.
Fetch_row () returns a result record in the form of a normal index array.
Field_seek () is used to set the offset of fields in the result set.
Member attributes
$ Current_field: returns the offset of the field pointed to in the current result. it is an integer.
$ Field_count: obtains the number of columns in the result set.
$ Lengths returns an array and stores it in the result set to obtain the length of the current first column.
$ Num_row: number of rows in the returned result set (including)
Objects of the mysqli_result class. by default, the select statement is returned by executing the query () method in the mysqli object, and all the result data is retrieved from the mysql server back to the client and saved in the object.
If you want to temporarily leave the results on the mysql server and read records one by one only when necessary, you need to provide a value of MYSQL_USE_RESULT in the second parameter when calling the query () method. This parameter is useful when the size of the data set to be processed is relatively large or not suitable for retrieving all data to the client at a time. However, to know how many records are found in this query, it is only after all the result records are read. Use the query () method in the mysqli object to obtain the result set code:
$ Result = $ mysqli-> query ('select * from table limit 10'); // return the data to the client and parse the data from the result set.
The above introduces the mysqli_result class-member method, including some content, and hopes to help friends who are interested in PHP tutorials.