What is the Resource type? What should I do?

Source: Internet
Author: User
What is the Resource type? Http://docs.php.net/manual/zh/language.types.resource.php what is a Resource type?
Http://docs.php.net/manual/zh/language.types.resource.php

Share:
------ Solution --------------------
When you open the database and perform some IO operations, a resource indicator is returned, so that you do not need to reconnect to the database the next time you access the database.


For example, mysql_connect. file_open
------ Solution --------------------
For example,

$ Result = mysql_query ("SELECT * WHERE 1 = 1 ")
Or die ("Invalid query:". mysql_error ());
?>

The mysql_query () function sends an SQL statement to the MySQL database and returns a resource identifier $ result
The resource identifier contains the information returned by the database, that is, the information you need.
Another function is usually required to read the resource. for example, mysql_fetch_array ($ result) is required)

Also has its resource identifier, such as opendir (), open the Directory, this function will also return a resource identifier
These two types are different resource types.
I'm a newbie, Hey, my personal opinion.

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.