Oracle 5.0 Reference Manual page 2267

Table of Contents

Advertisement

=
=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
server
username
password
new_link
client_flags
Return Values
Returns a MySQL link identifier on success or
Changelog
Version
5.5.0
4.3.0
4.2.0
Examples
Example 20.27.
mysql_connect
Original MySQL API (Mysql)
The MySQL server. It can also include a port number. e.g.
"hostname:port" or a path to a local socket e.g. ":/path/to/socket" for
the localhost.
If the PHP directive
then the default value is 'localhost:3306'. In
parameter is ignored and value 'localhost:3306' is always used.
The username. Default value is defined by mysql.default_user. In
SQL safe
mode, this parameter is ignored and the name of the user
that owns the server process is used.
The password. Default value is defined by mysql.default_password.
In
SQL safe
mode, this parameter is ignored and empty password is
used.
If a second call is made to
arguments, no new link will be established, but instead, the link
identifier of the already opened link will be returned. The
parameter modifies this behavior and makes
always open a new link, even if
with the same parameters. In
ignored.
The
client_flags
of the following constants: 128 (enable
handling),
DATA LOCAL
MYSQL_CLIENT_COMPRESS
or
MYSQL_CLIENT_INTERACTIVE
Table 20.34, "MySQL client constants"
SQL safe
mode, this parameter is ignored.
on failure.
FALSE
Description
This function will generate an
error.
Added the
Added the
example
2247
mysql.default_host
is undefined (default),
mysql_connect
mysql_connect
SQL safe
mode, this parameter is
parameter can be a combination
LOAD
MYSQL_CLIENT_SSL
,
MYSQL_CLIENT_IGNORE_SPACE
. Read the section about
for further information. In
client_flags
parameter.
new_link
SQL safe
mode, this
with the same
new_link
mysql_connect
was called before
,
E_DEPRECATED
parameter.

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents