1. Computing

Discuss in my forum

MySQL_Close () PHP Function

Closing a MySQL connection from a PHP document

By , About.com Guide

Once you have opened a connection to your MySQL database from your PHP document, you can close it again using the mysql_close () function. Most of the time this isn't necessary, because MySQL connections are usually closed by default at the end of the script.

 <?php 
 $link = mysql_connect('localhost', 'mysql_user', 'mysql_password') ; 
 if (!$link) 
 { 
 die(mysql_error()) ; 
 } 
 print 'You are connected'; 
 mysql_close($link) ; 
 ?> 
  1. About.com
  2. Computing
  3. PHP / MySQL
  4. PHP Functions
  5. PHP Mysql_Close - MySQL Close Function - Close MySQL Connection

©2013 About.com. All rights reserved.