Documentation Home
MySQL PHP API
Download this Manual
PDF (US Ltr) - 2.8Mb
PDF (A4) - 2.8Mb
EPUB - 456.4Kb
HTML Download (TGZ) - 395.8Kb
HTML Download (Zip) - 409.6Kb


MySQL PHP API  /  ...  /  mysqli::close, mysqli_close

3.9.8 mysqli::close, mysqli_close

Copyright 1997-2014 the PHP Documentation Group.

  • mysqli::close

    mysqli_close

    Closes a previously opened database connection

Description

Object oriented style

bool mysqli::close();

Procedural style

bool mysqli_close(mysqli link);

Closes a previously opened database connection.

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

Parameters

link

Procedural style only: A link identifier returned by mysqli_connect or mysqli_init

Return Values

Returns TRUE on success or FALSE on failure.

Examples

See mysqli_connect.

Notes

Note

mysqli_close will not close persistent connections. For additional details, see the manual page on persistent connections.

See Also

mysqli::__construct
mysqli_init
mysqli_real_connect
mysqli_free_result


User Comments
Sign Up Login You must be logged in to post a comment.