Home > Article > Backend Development > mysqli_result class--member methods
mysqli_result class--Member method
close() Releases the inner part and closes the result set. Once the result set is called, it can no longer be used.
data_seek() having , returns an object containing column information.
fetch_array() will return a result record in the form of a normal index array and an associative array.
fetch_assoc() will return a result record in the form of a normal associative array.
fetch_object() will Return a result record in the form of an object
fetch_row() use using using ‐ ‐ ‐ ‐ ‐ ‐ ‐ ‐ return a result record in the form of an ordinary index array
field_seek() . The offset position is an integer
$field_count ‐ ’ ’ s ’ s ‐ ‐ ‐ to the result set to get the length of the first column
Objects of the mysqli_result class are returned by default by executing the select statement through the query() method in the mysqli object, and all the result data are retrieved from the mysql server to the client and saved in the object.
If you want to temporarily leave the results on the mysql server and read the records one by one when necessary, you need to provide a MYSQL_USE_RESULT value in the second parameter when calling the query() method. It is more useful to use this parameter when the size of the data set being processed is relatively large or is not suitable for fetching it all back to the client at once. However, if you want to know how many records were found in this query, you can only know after all the result records have been read. Code for obtaining the result set using the query() method in the mysqli object:
$result=$mysqli->query('select * from table limit 10'); //Get the data back to the client and parse it from the result set Data
The above introduces the mysqli_result class - member methods, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.