No cache version.

Caching disabled. Default setting for this page:enabled (code LNG204)
If the display is too slow, you can disable the user mode to view the cached version.

Rechercher une fonction PHP

mysql_close

(PHP 4, PHP 5)

mysql_closeClose MySQL connection

Warning

This extension was deprecated in PHP 5.5.0, and it was removed in PHP 7.0.0. Instead, the MySQLi or PDO_MySQL extension should be used. See also MySQL: choosing an API guide and related FAQ for more information. Alternatives to this function include:

Description

mysql_close ([ resource $link_identifier = NULL ] ) : bool

mysql_close() closes the non-persistent connection to the MySQL server that's associated with the specified link identifier. If link_identifier isn't specified, the last opened link is used.

Open non-persistent MySQL connections and result sets are automatically destroyed when a PHP script finishes its execution. So, while explicitly closing open connections and freeing result sets is optional, doing so is recommended. This will immediately return resources to PHP and MySQL, which can improve performance. For related information, see freeing resources

PHP: mysql_close - Manual Home of Manuel PHP  Contents Haut

Parameters

link_identifier

The MySQL connection. If the link identifier is not specified, the last link opened by mysql_connect() is assumed. If no connection is found or established, an E_WARNING level error is generated.

PHP: mysql_close - Manual Home of Manuel PHP  Contents Haut

Return Values

Returns TRUE on success or FALSE on failure.

PHP: mysql_close - Manual Home of Manuel PHP  Contents Haut

Examples

Example #1 mysql_close() example

<?php
$link 
mysql_connect('localhost''mysql_user''mysql_password');
if (!
$link) {
    die(
'Could not connect: ' mysql_error());
}
echo 
'Connected successfully';
mysql_close($link);
?>

The above example will output:

Connected successfully

PHP: mysql_close - Manual Home of Manuel PHP  Contents Haut

Notes

Note:

mysql_close() will not close persistent links created by mysql_pconnect(). For additional details, see the manual page on persistent connections.

PHP: mysql_close - Manual Home of Manuel PHP  Contents Haut

See Also

Find a PHP function
Error Infobrol

Can not display this page of the Infobrol website

Type of error (18-01)

Unknown format specifier "&"

Please try again in a few minutes…

Return to the home page




Steph