<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.4 $ -->
  <refentry id="function.mysqli-real-connect">
   <refnamediv>
    <refname>mysqli_real_connect</refname>
    <refname>mysqli->real_connect</refname>
    <refpurpose>Opens a connection to a mysql server</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <para>Procedural style</para>
     <methodsynopsis>
      <type>bool</type><methodname>mysqli_real_connect</methodname>
      <methodparam><type>object</type><parameter>link</parameter></methodparam>
      <methodparam choice='opt'><type>string</type><parameter>hostname</parameter></methodparam>
      <methodparam choice='opt'><type>string</type><parameter>username</parameter></methodparam>
      <methodparam choice='opt'><type>string</type><parameter>passwd</parameter></methodparam>
      <methodparam choice='opt'><type>string</type><parameter>dbname</parameter></methodparam>
      <methodparam choice='opt'><type>int</type><parameter>port</parameter></methodparam>
      <methodparam choice='opt'><type>string</type><parameter>socket</parameter></methodparam>
      <methodparam choice='opt'><type>int</type><parameter>flags</parameter></methodparam>
     </methodsynopsis>
     <para>Object oriented style (method)</para>
     <classsynopsis>
      <ooclass><classname>mysqli</classname></ooclass>
      <methodsynopsis>
       <type>bool</type>
       <methodname>real_connect</methodname>
       <methodparam choice='opt'><type>string</type><parameter>hostname</parameter></methodparam>
       <methodparam choice='opt'><type>string</type><parameter>username</parameter></methodparam>
       <methodparam choice='opt'><type>string</type><parameter>passwd</parameter></methodparam>
       <methodparam choice='opt'><type>string</type><parameter>dbname</parameter></methodparam>
       <methodparam choice='opt'><type>int</type><parameter>port</parameter></methodparam>
       <methodparam choice='opt'><type>string</type><parameter>socket</parameter></methodparam>
       <methodparam choice='opt'><type>int</type><parameter>flags</parameter></methodparam>
      </methodsynopsis>
     </classsynopsis>
    <para>
     mysql_real_connect() attempts to establish a connection to a MySQL database engine running on host. 
    </para> 
    <para>
     This function differs from <function>mysqli_connect</function>:
    </para>
    <itemizedlist>
     <listitem>
      <para>
       <function>mysqli_real_connect</function> needs a valid object which has to be created by function
       <function>mysqli_init</function>
      </para>
     </listitem>
     <listitem>
      <para>
       With function <function>mysqli_options</function> you can set various options for connection.
      </para>
     </listitem>
     <listitem>
      <para>
       With the parameter <parameter>flags</parameter> you can set diffrent connection options:
      </para>
      <table>
       <title>Supported flags</title>
       <tgroup cols='2'>
       <thead>
        <row>
         <entry>Name</entry>
         <entry>Description</entry>
        </row>
       </thead>
       <tbody>
        <row>
         <entry><literal>MYSQLI_CLIENT_COMPRESS</literal></entry>
         <entry>Use compression protocol</entry>
        </row>
        <row>
         <entry><literal>MYSQLI_CLIENT_FOUND_ROWS</literal></entry>
         <entry>return number of matched rows, not the number of affected rows</entry>
        </row>
        <row>
         <entry><literal>MYSQLI_CLIENT_IGNORE_SPACE</literal></entry>
         <entry>Allow spaces after function names. Makes all function names reserved words.</entry>
        </row>
        <row>
         <entry><literal>MYSQLI_CLIENT_INTERACTIVE</literal></entry>
         <entry>
          Allow <literal>interactive_timeout</literal> seconds (instead of 
          <literal>wait_timeout</literal> seconds) of inactivity before closing the connection
         </entry>
        </row>
        <row>
         <entry><literal>MYSQLI_CLIENT_SSL</literal></entry>
         <entry>Use SSL (encryption)</entry>
        </row>
        </tbody>
       </tgroup>
      </table>
      <note>
       <para>
        For security reasons the <literal>MULTI_STATEMENT</literal> flag is not supported in 
        PHP. If you want to execute multiple queries use the 
        <function>mysqli_multi_query</function> function.
       </para>
      </note>
     </listitem>
    </itemizedlist>
   </refsect1>
   <refsect1>
    &reftitle.returnvalues;
    <para>&return.success;</para>
   </refsect1>
   <refsect1>
    &reftitle.seealso;
    <para>
     <function>mysqli_connect</function>,
     <function>mysqli_init</function>,
     <function>mysqli_options</function>,
     <function>mysqli_ssl_set</function>,
     <function>mysqli_close</function>.
    </para>
   </refsect1>
  </refentry>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->