Differences between mysqli_fetch_assoc () and mysqli_fetch_row () in php. Both mysqli_fetch_assoc () and mysqli_fetch_row () are used to return the query results to an array. both return the first row and move the pointer down the row. Difference: mysqli_fetch_assoc () uses the keyword mysqli_fetch_assoc () and mysqli_fetch_row () to return the query results to an array. both return the first row and move the pointer down one row.
Difference: mysqli_fetch_assoc () is indexed with a keyword. For example:
$ Row = $ result-> fetch_assoc ();
Echo $ row ['username'];
However, mysqli_fetch_row () uses the numeric index value. For example:
$ Row = $ result-> fetch_row ();
Echo $ row [0]; // note: "0" indicates the first field in the table (that is, username is the first field in the table ).
Another function: mysqli_fetch_object () is used to return a row to an object, and then take the value through the class method, for example:
$ Row = $ result-> fetch_object ();
Echo $ row-> username;
Values () and mysqli_fetch_row () both return the query results to an array. they both return the first row and move the pointer down the row. Difference: mysqli_fetch_assoc () keyword...