What problems does MYSQL_ASSOC encounter during operations?

Source: Internet
Author: User

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:

 
 
  1. Function fetch_array ($ input, $ type = MYSQL_ASSOC)
  2. {
  3. $ Output = @ mysql_fetch_array ($ input, $ type );
  4. Return $ output;
  5. }

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.