Home > Backend Development > PHP Problem > How to close the result set in php

How to close the result set in php

藏色散人
Release: 2023-03-14 21:04:01
Original
2277 people have browsed it

php method to close the result set: 1. Recycle the result set through "mysql_free_result($b);"; 2. Use "mysql_close($con);" to close the database connection.

How to close the result set in php

The operating environment of this article: Windows 7 system, PHP version 7.1, DELL G3 computer

How to close the result set in php?

Use mysql_free_result($b); to recycle the result set;

Use mysql_close($con); to close the database connection;

mysql_free_result() The function frees the resulting memory.

Returns true if successful, false if failed.

Syntax

mysql_free_result(data)
Copy after login

Parameter data is required. The result identifier to be freed. The result identifier is the result returned from mysql_query().

mysql_close() Function closes non-persistent MySQL connections.

Syntax

mysql_close(link_identifier)
Copy after login

Parameters link_identifier required. MySQL connection identifier. If not specified, the connection last opened by mysql_connect() is used by default. If the connection is not found, the function attempts to call mysql_connect() to establish a connection and use it. If an accident occurs and the connection is not found or cannot be established, the system issues an E_WARNING level warning message.

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of How to close the result set in php. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template