PHP/MySQL Database/mysql close

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

Disconnecting from a MySQL Database

   <source lang="html4strict">

mysql_connect("localhost", "phpuser", "password");

   mysql_select_db("phpdb");
   mysql_close( );
 
 </source>
   
  


function mysql_close() closes the connection.

   <source lang="html4strict">

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(); ?>

 </source>