This article mainly introduces the following content in the source code of MYSQL_ASSOC. I don't know what it is? So what is MYSQL_ASSOC? What are their main functions?
As follows:
- Function fetch_array ($ input, $ type = MYSQL_ASSOC)
- {
- $ Output = @ mysql_fetch_array ($ input, $ type );
- Return $ output;
- }
What is MYSQL_ASSOC? What is the function?
The second optional parameter result_type in mysql_fetch_array () is a constant and can accept the following values: MYSQL_ASSOC, MYSQL_NUM, and MYSQL_BOTH. This feature is newly added in PHP 3.0.7. The default value of this parameter is MYSQL_BOTH.
If MYSQL_BOTH is used, an array containing both join and numeric indexes is obtained. Using MYSQL_ASSOC to get only the associated index is like mysql_fetch_assoc (), and using MYSQL_NUM to get only the numeric index as mysql_fetch_row ).
The above content is an introduction to MYSQL_ASSOC. I hope you will get something better.