It doesn’t take too much thinking to realize that fetching an associative array is no different than loading a string from a file. What I mean by this is that you’re only looking at a single line of code that would be in your if/else branch and you don’t have to do a whole lot of additional processing.
In mysqli_fetch_assoc(), a variable is returned that has the same value as the value of the specified key in the associative array. This is a very cheap way of creating a string that is the result of an array lookup. For example, mysqli_fetch_assoc(“idx_name”, $row) will return a string that looks like idx_name.
A mysqli_fetch_assoc_result returns the result of an array lookup.
If you are looking for an easy way to get the last idx_name row in a table, you could just use mysqli_fetch_associdx_result.
This is really a good example of why I don’t like using the mysql_* functions. The mysql_* functions look at the data you pass in the query and use that data to build an array of values.
We use mysqli_fetch_associdx_result to get the idx_name row of a table and assign it to the variable my_idx_name. Then we use my_idx_name to get the idx_name row from another table. That is basically what the mysql_ functions are doing.
Mysqli_fetch_associdx_result is just returning a list of values, but it doesn’t actually do anything. Mysqli_fetch_associdx_result is used in mysql_fetch_assoc() because of the extra parentheses in mysqli_fetch_associdx_result.
We use Mysqli_fetch_associdx_result to get the idx_name row of a table and assign it to the variable my_idx_name. Then we use my_idx_name to get the idx_name row from another table. That is basically what the mysql_ functions are doing.
The mysql_ functions are used to fetch all the idx_name rows from a table, and I dont know how this happens, but I think mysql_fetch_associdx_result is doing this for us because it is being passed the idx_name row from the first table.
It is, but the purpose of the mysql_ functions is to create a table called my_idx_name for us. In our case, the name of the table is my_idx_name.