<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.mysqli-result.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'de',
  ),
  'this' => 
  array (
    0 => 'mysqli-result.construct.php',
    1 => 'mysqli_result::__construct',
    2 => 'Erstellt ein mysqli_result-Objekt',
  ),
  'up' => 
  array (
    0 => 'class.mysqli-result.php',
    1 => 'mysqli_result',
  ),
  'prev' => 
  array (
    0 => 'class.mysqli-result.php',
    1 => 'mysqli_result',
  ),
  'next' => 
  array (
    0 => 'mysqli-result.current-field.php',
    1 => 'mysqli_result::$current_field',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'de',
    'path' => 'reference/mysqli/mysqli_result/construct.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="mysqli-result.construct" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">mysqli_result::__construct</h1>
  <p class="verinfo">(PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">mysqli_result::__construct</span> &mdash; <span class="dc-title">Erstellt ein <span class="classname"><a href="class.mysqli-result.php" class="classname">mysqli_result</a></span>-Objekt</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-mysqli-result.construct-description">
  <h3 class="title">Beschreibung</h3>
  <div class="constructorsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>mysqli_result::__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"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$result_mode</code><span class="initializer"> = <strong><code><a href="mysqli.constants.php#constant.mysqli-store-result">MYSQLI_STORE_RESULT</a></code></strong></span></span>)</div>

  <p class="para rdfs-comment">
   Diese Methode erstellt ein neues <span class="classname"><a href="class.mysqli-result.php" class="classname">mysqli_result</a></span>-Objekt.
  </p>
  <p class="para">
   Sie kann nach dem Aufruf einer der Funktionen
   <span class="function"><a href="mysqli.real-query.php" class="function">mysqli_real_query()</a></span> oder
   <span class="function"><a href="mysqli.multi-query.php" class="function">mysqli_multi_query()</a></span> verwendet werden, um ein
   <span class="classname"><a href="class.mysqli-result.php" class="classname">mysqli_result</a></span>-Objekt zu erstellen. Das Objekt
   manuell zu konstruieren entspricht dem Aufruf der Funktionen
   <span class="function"><a href="mysqli.store-result.php" class="function">mysqli_store_result()</a></span> oder
   <span class="function"><a href="mysqli.use-result.php" class="function">mysqli_use_result()</a></span>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-mysqli-result.construct-parameters">
  <h3 class="title">Parameter-Liste</h3>
  <dl>
   <dt>
<code class="parameter">mysql</code></dt><dd><p class="para">Nur bei prozeduralem Aufruf: ein von
<span class="function"><a href="function.mysqli-connect.php" class="function">mysqli_connect()</a></span> oder <span class="function"><a href="mysqli.init.php" class="function">mysqli_init()</a></span>
zurückgegebenes <span class="classname"><a href="class.mysqli.php" class="classname">mysqli</a></span>-Objekt.</p></dd>
   
    <dt><code class="parameter">result_mode</code></dt>
    <dd>
     <p class="para">
      Der Ergebnismodus kann eine von 2 Konstanten sein, die angeben, wie das
      Ergebnis vom MySQL-Server zurückgegeben wird.
     </p>
     <p class="para">
      <strong><code><a href="mysqli.constants.php#constant.mysqli-store-result">MYSQLI_STORE_RESULT</a></code></strong> (Standard) - erstellt ein
      <span class="classname"><a href="class.mysqli-result.php" class="classname">mysqli_result</a></span>-Objekt mit einer gepufferten
      Ergebnismenge.
     </p>
     <p class="para">
      <strong><code><a href="mysqli.constants.php#constant.mysqli-use-result">MYSQLI_USE_RESULT</a></code></strong> - erstellt ein
      <span class="classname"><a href="class.mysqli-result.php" class="classname">mysqli_result</a></span>-Objekt mit einer ungepufferten
      Ergebnismenge. Solange es noch Datensätze gibt, die darauf warten,
      abgerufen zu werden, ist die Verbindung belegt und alle nachfolgenden
      Aufrufe geben den Fehler <code class="literal">Commands out of sync</code> zurück.
      Um den Fehler zu vermeiden, müssen alle Datensätze vom Server abgerufen
      werden oder die Ergebnismenge muss durch den Aufruf der Funktion
      <span class="function"><a href="mysqli-result.free.php" class="function">mysqli_free_result()</a></span> verworfen werden. Die Verbindung
      muss offen bleiben, damit die Zeilen abgerufen werden können.
     </p>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 errors" id="refsect1-mysqli-result.construct-errors">
  <h3 class="title">Fehler/Exceptions</h3>
  <p class="para">
If mysqli error reporting is enabled (<strong><code><a href="mysqli.constants.php#constant.mysqli-report-error">MYSQLI_REPORT_ERROR</a></code></strong>) and the requested operation fails,
a warning is generated. If, in addition, the mode is set to <strong><code><a href="mysqli.constants.php#constant.mysqli-report-strict">MYSQLI_REPORT_STRICT</a></code></strong>,
a <span class="classname"><a href="class.mysqli-sql-exception.php" class="classname">mysqli_sql_exception</a></span> is thrown instead.</p>
 </div>


 <div class="refsect1 examples" id="refsect1-mysqli-result.construct-examples">
  <h3 class="title">Beispiele</h3>
  <div class="example" id="example-1">
   <p><strong>Beispiel #1 Erstellen eines <span class="classname"><a href="class.mysqli-result.php" class="classname">mysqli_result</a></span>-Objekts</strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /><br />mysqli_report</span><span style="color: #007700">(</span><span style="color: #0000BB">MYSQLI_REPORT_ERROR </span><span style="color: #007700">| </span><span style="color: #0000BB">MYSQLI_REPORT_STRICT</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$mysqli </span><span style="color: #007700">= new </span><span style="color: #0000BB">mysqli</span><span style="color: #007700">(</span><span style="color: #DD0000">"localhost"</span><span style="color: #007700">, </span><span style="color: #DD0000">"my_user"</span><span style="color: #007700">, </span><span style="color: #DD0000">"my_password"</span><span style="color: #007700">, </span><span style="color: #DD0000">"world"</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">/* Select-Abfragen geben eine Ergebnismenge zurück */<br /></span><span style="color: #0000BB">$mysqli</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">real_query</span><span style="color: #007700">(</span><span style="color: #DD0000">"SELECT Name FROM City LIMIT 10"</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$result </span><span style="color: #007700">= new </span><span style="color: #0000BB">mysqli_result</span><span style="color: #007700">(</span><span style="color: #0000BB">$mysqli</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">printf</span><span style="color: #007700">(</span><span style="color: #DD0000">"Select gab %d Zeilen zurück.\n"</span><span style="color: #007700">, </span><span style="color: #0000BB">$result</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">num_rows</span><span style="color: #007700">);</span></span></code></div>
   </div>

   <div class="example-contents"><p>Oben gezeigte Beispiele erzeugen
eine ähnliche Ausgabe wie:</p></div>
   <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">Select gab 10 Zeilen zurück.</pre>
</div>
   </div>
  </div>
 </div>


 <div class="refsect1 seealso" id="refsect1-mysqli-result.construct-seealso">
  <h3 class="title">Siehe auch</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="mysqli.multi-query.php" class="function" rel="rdfs-seeAlso">mysqli_multi_query()</a> - F&uuml;hrt eine oder mehrere Abfragen in einer Datenbank durch</span></li>
    <li><span class="function"><a href="mysqli.real-query.php" class="function" rel="rdfs-seeAlso">mysqli_real_query()</a> - F&uuml;hrt eine SQL-Abfrage aus</span></li>
    <li><span class="function"><a href="mysqli.store-result.php" class="function" rel="rdfs-seeAlso">mysqli_store_result()</a> - &Uuml;bertr&auml;gt die Ergebnismenge der letzten Abfrage</span></li>
    <li><span class="function"><a href="mysqli.use-result.php" class="function" rel="rdfs-seeAlso">mysqli_use_result()</a> - Initiiert den Abruf einer Ergebnismenge</span></li>
   </ul>
  </p>
 </div>


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