|
mysql_connectOpen a connection to a MySQL Server Warning
This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQL extension should be used. See also MySQL: choosing an API guide and related FAQ for more information. Alternatives to this function include:
Description
resource mysql_connect
([ string
$server = ini_get("mysql.default_host")
[, string $username = ini_get("mysql.default_user")
[, string $password = ini_get("mysql.default_password")
[, bool $new_link = false
[, int $client_flags = 0
]]]]] )Opens or reuses a connection to a MySQL server. Parameters
Return Values
Returns a MySQL link identifier on success or Changelog
Examples
Example #1 mysql_connect example
<?php
Example #2 mysql_connect example using hostname:port syntax
<?php
Example #3 mysql_connect example using ":/path/to/socket" syntax
<?php Notes
See Also
|