Документ взят из кэша поисковой машины. Адрес
оригинального документа
: http://old.master.cmc.msu.ru/php/function.mysql-connect.html
Дата изменения: Sun Feb 3 22:47:22 2002 Дата индексирования: Tue Oct 2 07:46:57 2012 Кодировка: |
Returns a MySQL link identifier on success, or FALSE on failure.
mysql_connect() establishes a connection to a MySQL server. The following defaults are assumed for missing optional parameters: server = 'localhost:3306', username = name of the user that owns the server process and password = empty password.
The server parameter can also include a port number. eg. "hostname:port" or a path to a socket eg. ":/path/to/socket" for the localhost.
Note: Support for ":port" was added in PHP 3.0B4.
Support for ":/path/to/socket" was added in PHP 3.0.10.
You can suppress the error message on failure by prepending '@' to the function name.
If a second call is made to mysql_connect() with the same arguments, no new link will be established, but instead, the link identifier of the already opened link will be returned.
The link to the server will be closed as soon as the execution of the script ends, unless it's closed earlier by explicitly calling mysql_close().
See also mysql_pconnect() and mysql_close().