<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.mysqli-stmt.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'fr',
  ),
  'this' => 
  array (
    0 => 'mysqli-stmt.construct.php',
    1 => 'mysqli_stmt::__construct',
    2 => 'Construit un nouvel objet mysqli_stmt',
  ),
  'up' => 
  array (
    0 => 'class.mysqli-stmt.php',
    1 => 'mysqli_stmt',
  ),
  'prev' => 
  array (
    0 => 'mysqli-stmt.close.php',
    1 => 'mysqli_stmt::close',
  ),
  'next' => 
  array (
    0 => 'mysqli-stmt.data-seek.php',
    1 => 'mysqli_stmt::data_seek',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    'path' => 'reference/mysqli/mysqli_stmt/construct.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="mysqli-stmt.construct" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">mysqli_stmt::__construct</h1>
  <p class="verinfo">(PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">mysqli_stmt::__construct</span> &mdash; <span class="dc-title">Construit un nouvel objet <span class="classname"><a href="class.mysqli-stmt.php" class="classname">mysqli_stmt</a></span></span></p>

 </div>

 <div class="refsect1 description" id="refsect1-mysqli-stmt.construct-description">
  <h3 class="title">Description</h3>
  <div class="constructorsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>mysqli_stmt::__construct</strong></span>(<span class="methodparam"><span class="type"><a href="class.mysqli.php" class="type mysqli">mysqli</a></span> <code class="parameter">$mysql</code></span>, <span class="methodparam"><span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.string.php" class="type string">string</a></span></span> <code class="parameter">$query</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>)</div>

  <p class="para rdfs-comment">
   Cette méthode construit un nouvel objet
   <span class="classname"><a href="class.mysqli-stmt.php" class="classname">mysqli_stmt</a></span>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-mysqli-stmt.construct-parameters">
  <h3 class="title">Liste de paramètres</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">link</code></dt>
     <dd>
      <p class="para">
       Un objet <span class="classname"><a href="class.mysqli.php" class="classname">mysqli</a></span> valide.
      </p>
     </dd>
    
    
     <dt><code class="parameter">query</code></dt>
     <dd>
      <p class="para">
       La requête, sous la forme d&#039;une chaîne de caractères. Si ce paramètre est <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong>,
       alors le constructeur se comporte comme la fonction
       <span class="function"><a href="mysqli.stmt-init.php" class="function">mysqli_stmt_init()</a></span> ; sinon il
       se comportera comme la fonction <span class="function"><a href="mysqli.prepare.php" class="function">mysqli_prepare()</a></span>.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-mysqli-stmt.construct-errors">
  <h3 class="title">Erreurs / Exceptions</h3>
  <p class="para">
Si le rapport d&#039;erreurs mysqli est activé (<strong><code><a href="mysqli.constants.php#constant.mysqli-report-error">MYSQLI_REPORT_ERROR</a></code></strong>) et que l&#039;opération demandée échoue,
un avertissement est généré. Si, en plus, le mode est défini sur <strong><code><a href="mysqli.constants.php#constant.mysqli-report-strict">MYSQLI_REPORT_STRICT</a></code></strong>,
une <span class="classname"><a href="class.mysqli-sql-exception.php" class="classname">mysqli_sql_exception</a></span> est lancée à la place.</p>
 </div>


 <div class="refsect1 changelog" id="refsect1-mysqli-stmt.construct-changelog">
  <h3 class="title">Historique</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Version</th>
      <th>Description</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>8.0.0</td>
      <td>
       <code class="parameter">query</code> est désormais nullable.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 seealso" id="refsect1-mysqli-stmt.construct-seealso">
  <h3 class="title">Voir aussi</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="mysqli.prepare.php" class="function" rel="rdfs-seeAlso">mysqli_prepare()</a> - Pr&eacute;pare une requ&ecirc;te SQL pour l'ex&eacute;cution</span></li>
    <li><span class="function"><a href="mysqli.stmt-init.php" class="function" rel="rdfs-seeAlso">mysqli_stmt_init()</a> - Initialise une commande MySQL</span></li>
   </ul>
  </p>
 </div>

</div><?php manual_footer($setup); ?>