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>
...
...
@@ -168,6 +168,13 @@
168
168
<entry><constant>MYSQLI_CLIENT_SSL</constant></entry>
169
169
<entry>Use SSL (encryption)</entry>
170
170
</row>
171
+
<row>
172
+
<entry><constant>MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT</constant></entry>
173
+
<entry>
174
+
Like <constant>MYSQLI_CLIENT_SSL</constant>, but disables validation of the provided
175
+
SSL certificate. This is only for installations using MySQL Native Driver and MySQL 5.6 or later.
176
+
</entry>
177
+
</row>
171
178
</tbody>
172
179
</tgroup>
173
180
</table>
...
...
@@ -191,6 +198,35 @@
191
198
</para>
192
199
</refsect1>
193
200

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

206
+
<refsect1 role="changelog">
207
+
&reftitle.changelog;
208
+
<para>
209
+
<informaltable>
210
+
<tgroup cols="2">
211
+
<thead>
212
+
<row>
213
+
<entry>&Version;</entry>
214
+
<entry>&Description;</entry>
215
+
</row>
216
+
</thead>
217
+
<tbody>
218
+
<row>
219
+
<entry>7.4.0</entry>
220
+
<entry>
221
+
All parameters are now nullable.
222
+
</entry>
223
+
</row>
224
+
</tbody>
225
+
</tgroup>
226
+
</informaltable>
227
+
</para>
228
+
</refsect1>
229
+

194
230
<refsect1 role="examples">
195
231
&reftitle.examples;
196
232
<example>
...
...
@@ -231,7 +267,7 @@ $mysqli->close();
231
267

232
268
class foo_mysqli extends mysqli {
233
269
public function __construct($host, $user, $pass, $db) {
234
-
parent::init();
270
+
parent::__construct();
235
271

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

315
351
</refentry>
316
-

317
352
<!-- Keep this comment at the end of the file
318
353
Local variables:
319
354
mode: sgml
320
355