H I O X INDIA
Online PHP Tutorial
 HOME  ||  Scripts  ||  Purchase  ||  Tutorials  ||  Images  ||  Tools  ||  Templates 
  :-)  Send Page   :-)   Feedback   :-)   Register   :-)   Links   :-)   Support   :-)
Español Français 中文 Deutsch
 Forums   Hosting   Internet Stats   Easy Calculation   FUN Games 

PHP Topics
Introduction
Syntax
Data Types
Variables
Operators
Control Structures
Functions
Pre-defined Function
Calendar Functions
Date and Time
Array Functions
Array Functions List1
Array Functions List2
Math Functions
PHP Mysql Functions
File Handling
Error Handling
DB Size
PHP Mail
String Tokens
String Functions
String Functions List1
String Functions List2
Session Functions
Cookies Functions
Form Variables
Running PHP from JS
Array To JS
Array to PHP
Encryption
Common Header
Ask Your Doubts
More about PHP
Feedback




mysql_close() Function in PHP


Topic

What is mysql_close function in PHP?
How does mysql_close() works?




Explanation

The mysql_close function is used to close MySQL connection.

Syntax
bool mysql_close ( [resource link_identifier])

Returns: TRUE on success, FALSE on error.

Once you have opened a connection to your MySQL database from your PHP document, you can close it again using the mysql_close() function with link identifier as argument. If link_identifier is not specified,then the last opened link is used.

Using mysql_close() is not usually necessary, as non-persistent open links are automatically closed at the end of the script's execution

mysql_close() will not close persistent links created by mysql_pconnect().

Example


<?php

// Attempt to connect to the default database server
$link = mysql_connect("mysql_host", "mysql_user", "mysql_password")
or die ("Could not connect");

print 'You are connected';

//close connection
mysql_close($link) ;
?>


See also: mysql_connect() and mysql_pconnect()





privacypolicy     licence     sitemap
(c) copyright, 2004 hioxindia.com