reference/mysqli/mysqli/real-connect.xml
a2ef8f387d2264f26131c0a270f534141a68e18c
...
...
@@ -10,27 +10,27 @@
10
10
<refsect1 role="description">
11
11
&reftitle.description;
12
12
<para>&style.oop;</para>
13
-
<methodsynopsis role="oop">
14
-
<type>bool</type><methodname>mysqli::real_connect</methodname>
15
-
<methodparam choice="opt"><type>string</type><parameter>host</parameter></methodparam>
16
-
<methodparam choice="opt"><type>string</type><parameter>username</parameter></methodparam>
17
-
<methodparam choice="opt"><type>string</type><parameter>passwd</parameter></methodparam>
18
-
<methodparam choice="opt"><type>string</type><parameter>dbname</parameter></methodparam>
19
-
<methodparam choice="opt"><type>int</type><parameter>port</parameter></methodparam>
20
-
<methodparam choice="opt"><type>string</type><parameter>socket</parameter></methodparam>
21
-
<methodparam choice="opt"><type>int</type><parameter>flags</parameter></methodparam>
13
+
<methodsynopsis role="mysqli">
14
+
<modifier>public</modifier> <type>bool</type><methodname>mysqli::real_connect</methodname>
15
+
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>hostname</parameter><initializer>&null;</initializer></methodparam>
16
+
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>username</parameter><initializer>&null;</initializer></methodparam>
17
+
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>password</parameter><initializer>&null;</initializer></methodparam>
18
+
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>database</parameter><initializer>&null;</initializer></methodparam>
19
+
<methodparam choice="opt"><type class="union"><type>int</type><type>null</type></type><parameter>port</parameter><initializer>&null;</initializer></methodparam>
20
+
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>socket</parameter><initializer>&null;</initializer></methodparam>
21
+
<methodparam choice="opt"><type>int</type><parameter>flags</parameter><initializer>0</initializer></methodparam>
22
22
</methodsynopsis>
23
23
<para>&style.procedural;</para>
24
24
<methodsynopsis>
25
25
<type>bool</type><methodname>mysqli_real_connect</methodname>
26
-
<methodparam><type>mysqli</type><parameter>link</parameter></methodparam>
27
-
<methodparam choice="opt"><type>string</type><parameter>host</parameter></methodparam>
28
-
<methodparam choice="opt"><type>string</type><parameter>username</parameter></methodparam>
29
-
<methodparam choice="opt"><type>string</type><parameter>passwd</parameter></methodparam>
30
-
<methodparam choice="opt"><type>string</type><parameter>dbname</parameter></methodparam>
31
-
<methodparam choice="opt"><type>int</type><parameter>port</parameter></methodparam>
32
-
<methodparam choice="opt"><type>string</type><parameter>socket</parameter></methodparam>
33
-
<methodparam choice="opt"><type>int</type><parameter>flags</parameter></methodparam>
26
+
<methodparam><type>mysqli</type><parameter>mysql</parameter></methodparam>
27
+
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>hostname</parameter><initializer>&null;</initializer></methodparam>
28
+
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>username</parameter><initializer>&null;</initializer></methodparam>
29
+
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>password</parameter><initializer>&null;</initializer></methodparam>
30
+
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>database</parameter><initializer>&null;</initializer></methodparam>
31
+
<methodparam choice="opt"><type class="union"><type>int</type><type>null</type></type><parameter>port</parameter><initializer>&null;</initializer></methodparam>
32
+
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>socket</parameter><initializer>&null;</initializer></methodparam>
33
+
<methodparam choice="opt"><type>int</type><parameter>flags</parameter><initializer>0</initializer></methodparam>
34
34
</methodsynopsis>
35
35
<para>
36
36
Establish a connection to a MySQL database engine.
...
...
@@ -65,13 +65,13 @@
65
65
<variablelist>
66
66
&mysqli.link.description;
67
67
<varlistentry>
68
-
<term><parameter>host</parameter></term>
68
+
<term><parameter>hostname</parameter></term>
69
69
<listitem>
70
70
<para>
71
-
Can be either a host name or an IP address. Passing the &null; value
72
-
or the string "localhost" to this parameter, the local host is
73
-
assumed. When possible, pipes will be used instead of the TCP/IP
74
-
protocol.
71
+
Can be either a host name or an IP address. When passing &null;, the value is retrieved from
72
+
<link linkend="ini.mysqli.default-host">mysqli.default_host</link>.
73
+
When possible, pipes will be used instead of the TCP/IP protocol.
74
+
The TCP/IP protocol is used if a host name and port number are provided together e.g. <literal>localhost:3308</literal>.
75
75
</para>
76
76
</listitem>
77
77
</varlistentry>
...
...
@@ -79,27 +79,25 @@
79
79
<term><parameter>username</parameter></term>
80
80
<listitem>
81
81
<para>
82
-
The MySQL user name.
82
+
The MySQL username or &null; to assume the username based on the
83
+
<link linkend="ini.mysqli.default-user">mysqli.default_user</link> ini option.
83
84
</para>
84
85
</listitem>
85
86
</varlistentry>
86
87
<varlistentry>
87
-
<term><parameter>passwd</parameter></term>
88
+
<term><parameter>password</parameter></term>
88
89
<listitem>
89
90
<para>
90
-
If provided or &null;, the MySQL server will attempt to authenticate
91
-
the user against those user records which have no password only. This
92
-
allows one username to be used with different permissions (depending
93
-
on if a password as provided or not).
91
+
The MySQL password or &null; to assume the password based on the
92
+
<link linkend="ini.mysqli.default-pw">mysqli.default_pw</link> ini option.
94
93
</para>
95
94
</listitem>
96
95
</varlistentry>
97
96
<varlistentry>
98
-
<term><parameter>dbname</parameter></term>
97
+
<term><parameter>database</parameter></term>
99
98
<listitem>
100
99
<para>
101
-
If provided will specify the default database to be used when
102
-
performing queries.
100
+
The default database to be used when performing queries or &null;.
103
101
</para>
104
102
</listitem>
105
103
</varlistentry>
...
...
@@ -107,7 +105,8 @@
107
105
<term><parameter>port</parameter></term>
108
106
<listitem>
109
107
<para>
110
-
Specifies the port number to attempt to connect to the MySQL server.
108
+
The port number to attempt to connect to the MySQL server or &null; to assume the port based on the
109
+
<link linkend="ini.mysqli.default-port">mysqli.default_port</link> ini option.
111
110
</para>
112
111
</listitem>
113
112
</varlistentry>
...
...
@@ -115,14 +114,15 @@
115
114
<term><parameter>socket</parameter></term>
116
115
<listitem>
117
116
<para>
118
-
Specifies the socket or named pipe that should be used.
117
+
The socket or named pipe that should be used or &null; to assume the socket based on the
118
+
<link linkend="ini.mysqli.default-socket">mysqli.default_socket</link> ini option.
119
119
</para>
120
120
<note>
121
121
<para>
122
122
Specifying the <parameter>socket</parameter> parameter will not
123
123
explicitly determine the type of connection to be used when
124
124
connecting to the MySQL server. How the connection is made to the
125
-
MySQL database is determined by the <parameter>host</parameter>
125
+
MySQL database is determined by the <parameter>hostname</parameter>
126
126
parameter.
127
127
</para>
128
128
</note>
...
...
@@ -135,7 +135,7 @@
135
135
With the parameter <parameter>flags</parameter> you can set different
136
136
connection options:
137
137
</para>
138
-
<table>
138
+
<table xml:id="mysqli.real-connect.flags">
139
139
<title>Supported flags</title>
140
140
<tgroup cols="2">
141
141
<thead>
...
...
@@ -191,7 +191,19 @@
191
191
</para>
192
192
</refsect1>
193
193

194
-
<refsect1 role="changelog"><!-- {{{ -->
194
+
<refsect1 role="returnvalues">
195
+
&reftitle.returnvalues;
196
+
<para>
197
+
&return.success;
198
+
</para>
199
+
</refsect1>
200
+

201
+
<refsect1 role="errors">
202
+
&reftitle.errors;
203
+
&mysqli.conditionalexception;
204
+
</refsect1>
205
+

206
+
<refsect1 role="changelog">
195
207
&reftitle.changelog;
196
208
<para>
197
209
<informaltable>
...
...
@@ -204,22 +216,15 @@
204
216
</thead>
205
217
<tbody>
206
218
<row>
207
-
<entry>5.6.16</entry>
219
+
<entry>7.4.0</entry>
208
220
<entry>
209
-
Added the <constant>MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT</constant> flag for MySQL Native Driver
221
+
All parameters are now nullable.
210
222
</entry>
211
223
</row>
212
224
</tbody>
213
225
</tgroup>
214
226
</informaltable>
215
227
</para>
216
-
</refsect1><!-- }}} -->
217
-

218
-
<refsect1 role="returnvalues">
219
-
&reftitle.returnvalues;
220
-
<para>
221
-
&return.success;
222
-
</para>
223
228
</refsect1>
224
229

225
230
<refsect1 role="examples">
...
...
@@ -262,7 +267,7 @@ $mysqli->close();
262
267

263
268
class foo_mysqli extends mysqli {
264
269
public function __construct($host, $user, $pass, $db) {
265
-
parent::init();
270
+
parent::__construct();
266
271

267
272
if (!parent::options(MYSQLI_INIT_COMMAND, 'SET AUTOCOMMIT = 0')) {
268
273
die('Setting MYSQLI_INIT_COMMAND failed');
...
...
@@ -344,7 +349,6 @@ Success... MySQL host info: localhost via TCP/IP
344
349
</refsect1>
345
350

346
351
</refentry>
347
-

348
352
<!-- Keep this comment at the end of the file
349
353
Local variables:
350
354
mode: sgml
351
355