PHP/MySQL Database/mysql close

Материал из Web эксперт
Перейти к: навигация, поиск

Disconnecting from a MySQL Database

 
mysql_connect("localhost", "phpuser", "password");
    mysql_select_db("phpdb");
    mysql_close( );



function mysql_close() closes the connection.

 
If the link_id is not specified, mysql_close() will close the most recently opened link. 
The syntax is: int mysql_close ([int link_id])
<?
@mysql_connect("localhost", "web", "asdf") or die("Could not connect to MySQL server!");
@mysql_select_db("company") or die("Could not select company database!");
print "You"re connected to a MySQL database!";
mysql_close();
?>