<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.mysql-xdevapi-result.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'es',
  ),
  'this' => 
  array (
    0 => 'mysql-xdevapi-result.getautoincrementvalue.php',
    1 => 'Result::getAutoIncrementValue',
    2 => 'Devuelve el valor auto-incrementado',
  ),
  'up' => 
  array (
    0 => 'class.mysql-xdevapi-result.php',
    1 => 'mysql_xdevapi\\Result',
  ),
  'prev' => 
  array (
    0 => 'mysql-xdevapi-result.getaffecteditemscount.php',
    1 => 'Result::getAffectedItemsCount',
  ),
  'next' => 
  array (
    0 => 'mysql-xdevapi-result.getgeneratedids.php',
    1 => 'Result::getGeneratedIds',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'es',
    'path' => 'reference/mysql_xdevapi/mysql_xdevapi/result/getautoincrementvalue.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="mysql-xdevapi-result.getautoincrementvalue" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Result::getAutoIncrementValue</h1>
  <p class="verinfo">(No version information available, might only be in Git)</p><p class="refpurpose"><span class="refname">Result::getAutoIncrementValue</span> &mdash; <span class="dc-title">Devuelve el valor auto-incrementado</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-mysql-xdevapi-result.getautoincrementvalue-description">
  <h3 class="title">Descripción</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>mysql_xdevapi\Result::getAutoIncrementValue</strong></span>(): <span class="type"><a href="language.types.integer.php" class="type int">int</a></span></div>

  <p class="para rdfs-comment">
   Devuelve el último valor AUTO_INCREMENT (último identificador insertado).
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-mysql-xdevapi-result.getautoincrementvalue-parameters">
  <h3 class="title">Parámetros</h3>
  <p class="para">Esta función no contiene ningún parámetro.</p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-mysql-xdevapi-result.getautoincrementvalue-returnvalues">
  <h3 class="title">Valores devueltos</h3>
  <p class="para">
   El último valor AUTO_INCREMENT.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-mysql-xdevapi-result.getautoincrementvalue-examples">
  <h3 class="title">Ejemplos</h3>
  <div class="example" id="example-1">
   <p><strong>Ejemplo #1 Ejemplo de <span class="function"><strong>mysql_xdevapi\Result::getAutoIncrementValue()</strong></span></strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$session </span><span style="color: #007700">= </span><span style="color: #0000BB">mysql_xdevapi\getSession</span><span style="color: #007700">(</span><span style="color: #DD0000">"mysqlx://user:password@localhost"</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$session</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">sql</span><span style="color: #007700">(</span><span style="color: #DD0000">"DROP DATABASE IF EXISTS addressbook"</span><span style="color: #007700">)-&gt;</span><span style="color: #0000BB">execute</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">$session</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">sql</span><span style="color: #007700">(</span><span style="color: #DD0000">"CREATE DATABASE addressbook"</span><span style="color: #007700">)-&gt;</span><span style="color: #0000BB">execute</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">$session</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">sql</span><span style="color: #007700">(</span><span style="color: #DD0000">"<br />  CREATE TABLE addressbook.names<br />    (id INT NOT NULL AUTO_INCREMENT, name VARCHAR(30), age INT, PRIMARY KEY (id))<br />  "</span><span style="color: #007700">)-&gt;</span><span style="color: #0000BB">execute</span><span style="color: #007700">();<br /><br /></span><span style="color: #0000BB">$schema </span><span style="color: #007700">= </span><span style="color: #0000BB">$session</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getSchema</span><span style="color: #007700">(</span><span style="color: #DD0000">"addressbook"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$table  </span><span style="color: #007700">= </span><span style="color: #0000BB">$schema</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getTable</span><span style="color: #007700">(</span><span style="color: #DD0000">"names"</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$result </span><span style="color: #007700">= </span><span style="color: #0000BB">$table</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">insert</span><span style="color: #007700">(</span><span style="color: #DD0000">"name"</span><span style="color: #007700">, </span><span style="color: #DD0000">"age"</span><span style="color: #007700">)-&gt;</span><span style="color: #0000BB">values</span><span style="color: #007700">([</span><span style="color: #DD0000">"Suzanne"</span><span style="color: #007700">, </span><span style="color: #0000BB">31</span><span style="color: #007700">],[</span><span style="color: #DD0000">"Julie"</span><span style="color: #007700">, </span><span style="color: #0000BB">43</span><span style="color: #007700">])-&gt;</span><span style="color: #0000BB">execute</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">$result </span><span style="color: #007700">= </span><span style="color: #0000BB">$table</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">insert</span><span style="color: #007700">(</span><span style="color: #DD0000">"name"</span><span style="color: #007700">, </span><span style="color: #DD0000">"age"</span><span style="color: #007700">)-&gt;</span><span style="color: #0000BB">values</span><span style="color: #007700">([</span><span style="color: #DD0000">"Suki"</span><span style="color: #007700">, </span><span style="color: #0000BB">34</span><span style="color: #007700">])-&gt;</span><span style="color: #0000BB">execute</span><span style="color: #007700">();<br /><br /></span><span style="color: #0000BB">$ai </span><span style="color: #007700">= </span><span style="color: #0000BB">$result</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getAutoIncrementValue</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$ai</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

   <div class="example-contents"><p>El ejemplo anterior mostrará:</p></div>
   <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">int(3)</pre>
</div>
   </div>
  </div>
 </div>


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