<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/book.mysqlnd.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'it',
  ),
  'this' => 
  array (
    0 => 'mysqlnd.overview.php',
    1 => 'Overview',
    2 => 'Overview',
  ),
  'up' => 
  array (
    0 => 'book.mysqlnd.php',
    1 => 'Mysqlnd',
  ),
  'prev' => 
  array (
    0 => 'book.mysqlnd.php',
    1 => 'Mysqlnd',
  ),
  'next' => 
  array (
    0 => 'mysqlnd.install.php',
    1 => 'Installation',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/mysqlnd/overview.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="mysqlnd.overview" class="chapter">
 <h1 class="title">Overview</h1>

 <p class="simpara">
  <strong>What it is not</strong>
 </p>
 <p class="simpara">
  Although MySQL Native Driver is written as a PHP extension, it is
  important to note that it does not provide a new API to the PHP
  programmer. The programmer APIs for MySQL database connectivity are
  provided by the MySQL extension, <code class="literal">mysqli</code> and PDO
  MYSQL. These extensions can now use the services of MySQL Native
  Driver to communicate with the MySQL Server. Therefore, you should not
  think of MySQL Native Driver as an API.
 </p>
 <p class="simpara">
  <strong>Why use it?</strong>
 </p>
 <p class="simpara">
  Using the MySQL Native Driver offers a number of advantages over using
  the MySQL Client Library.
 </p>
 <p class="simpara">
  The older MySQL Client Library was written by MySQL AB (now Oracle
  Corporation) and so was released under the MySQL license. This
  ultimately led to MySQL support being disabled by default in PHP.
  However, the MySQL Native Driver has been developed as part of the PHP
  project, and is therefore released under the PHP license. This removes
  licensing issues that have been problematic in the past.
 </p>
 <p class="simpara">
  Also, in the past, you needed to build the MySQL database extensions
  against a copy of the MySQL Client Library. This typically meant you
  needed to have MySQL installed on a machine where you were building
  the PHP source code. Also, when your PHP application was running, the
  MySQL database extensions would call down to the MySQL Client library
  file at run time, so the file needed to be installed on your system.
  With MySQL Native Driver that is no longer the case as it is included
  as part of the standard distribution. So you do not need MySQL
  installed in order to build PHP or run PHP database applications.
 </p>
 <p class="simpara">
  Because MySQL Native Driver is written as a PHP extension, it is
  tightly coupled to the workings of PHP. This leads to gains in
  efficiency, especially when it comes to memory usage, as the driver
  uses the PHP memory management system. It also supports the PHP memory
  limit. Using MySQL Native Driver leads to comparable or better
  performance than using MySQL Client Library, it always ensures the
  most efficient use of memory. One example of the memory efficiency is
  the fact that when using the MySQL Client Library, each row is stored
  in memory twice, whereas with the MySQL Native Driver each row is only
  stored once in memory.
 </p>
 <blockquote class="note"><p><strong class="note">Nota</strong>: 
  <strong>Reporting memory usage</strong><br />
  <span class="simpara">
   Because MySQL Native Driver uses the PHP memory management system, its
   memory usage can be tracked with <span class="function"><a href="function.memory-get-usage.php" class="function">memory_get_usage()</a></span>.
   This is not possible with libmysqlclient because it uses the C function malloc()
   instead.
  </span>
 </p></blockquote>
 <p class="simpara">
  <strong>Special features</strong>
 </p>
 <p class="simpara">
  MySQL Native Driver also provides some special features not available
  when the MySQL database extensions use MySQL Client Library. These
  special features are listed below:
 </p>
 <ul class="itemizedlist">
  <li class="listitem">
   <span class="simpara">
    Improved persistent connections
   </span>
  </li>
  <li class="listitem">
   <span class="simpara">
    The special function <span class="function"><a href="mysqli-result.fetch-all.php" class="function">mysqli_fetch_all()</a></span>
   </span>
  </li>
  <li class="listitem">
   <span class="simpara">
    Performance statistics calls:
    <span class="function"><a href="function.mysqli-get-client-stats.php" class="function">mysqli_get_client_stats()</a></span>,
    <span class="function"><a href="mysqli.get-connection-stats.php" class="function">mysqli_get_connection_stats()</a></span>
   </span>
  </li>
 </ul>
 <p class="simpara">
  The performance statistics facility can prove to be very useful in
  identifying performance bottlenecks.
 </p>
 <p class="simpara">
  MySQL Native Driver also allows for persistent connections when used
  with the <code class="literal">mysqli</code> extension.
 </p>
 <p class="simpara">
  <strong>SSL Support</strong>
 </p>
 <p class="simpara">
  MySQL Native Driver supports SSL.
 </p>
 <p class="simpara">
  <strong>Compressed Protocol Support</strong>
 </p>
 <p class="simpara">
  MySQL Native Driver supports the compressed client
  server protocol. Extension <code class="literal">ext/mysqli</code>, if configured to use MySQL Native Driver,
  can also take advantage of this feature. Note that <code class="literal">PDO_MYSQL</code>
  does <em>NOT</em> support compression when used together with mysqlnd.
 </p>
 <p class="simpara">
  <strong>Named Pipes Support</strong>
 </p>
 <p class="simpara">
  Named pipes can be used to connect on Windows environments.
 </p>
</div>
<?php manual_footer($setup); ?>