(PHP 4, PHP 5)
mysql_close — بستن اتصال MySQL
mysql_close() اتصال غیردائمی به MySQL server را که مشخص شده است میبندد.اگر link_identifier مشخص شده باشد آخرین پیوند باز را مورد استفاده قرار میدهد.
استفاده از mysql_close() معمولا مورد نیاز نیست اتصالات باز غیر دائمی به صورت خودکار در پایان اجرای اسکریپت بسته میشود. همچنین آزاد کردن منابع را ببینید.
The MySQL connection. If the link identifier is not specified, the last link opened by mysql_connect() is assumed. If no such link is found, it will try to create one as if mysql_connect() was called with no arguments. If no connection is found or established, an E_WARNING level error is generated.
Returns TRUE on success or FALSE on failure.
Example #1 مثال mysql_close()
<?php
$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);
?>
The above example will output:
Connected successfully
Note:
mysql_close()پیوندهای دائمی ایجاد شده توسطmysql_pconnect() را نمیبندد.