What is the Resource type? Docs. php. netmanualzhlanguage. types. resource. php: What is the 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.