<?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-executable.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'es',
  ),
  'this' => 
  array (
    0 => 'mysql-xdevapi-executable.execute.php',
    1 => 'Executable::execute',
    2 => 'Ejecuta una declaraci&oacute;n',
  ),
  'up' => 
  array (
    0 => 'class.mysql-xdevapi-executable.php',
    1 => 'mysql_xdevapi\\Executable',
  ),
  'prev' => 
  array (
    0 => 'class.mysql-xdevapi-executable.php',
    1 => 'mysql_xdevapi\\Executable',
  ),
  'next' => 
  array (
    0 => 'class.mysql-xdevapi-executionstatus.php',
    1 => 'mysql_xdevapi\\ExecutionStatus',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'es',
    'path' => 'reference/mysql_xdevapi/mysql_xdevapi/executable/execute.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="mysql-xdevapi-executable.execute" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Executable::execute</h1>
  <p class="verinfo">(No version information available, might only be in Git)</p><p class="refpurpose"><span class="refname">Executable::execute</span> &mdash; <span class="dc-title">Ejecuta una declaración</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-mysql-xdevapi-executable.execute-description">
  <h3 class="title">Descripción</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">abstract</span> <span class="modifier">public</span> <span class="methodname"><strong>mysql_xdevapi\Executable::execute</strong></span>(): <span class="type"><a href="class.mysql-xdevapi-result.php" class="type mysql_xdevapi\Result">mysql_xdevapi\Result</a></span></div>

  <p class="para rdfs-comment">
   Ejecuta la declaración a partir de una operación de colección o de una consulta de tabla;
   esta funcionalidad permite el encadenamiento de métodos.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-mysql-xdevapi-executable.execute-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-executable.execute-returnvalues">
  <h3 class="title">Valores devueltos</h3>
  <p class="para">
   Uno de los objetos Result, tales como Result o SqlStatementResult.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-mysql-xdevapi-executable.execute-examples">
  <h3 class="title">Ejemplos</h3>
  <div class="example" id="example-1">
   <p><strong>Ejemplo #1 Ejemplos de execute()</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">$result_sql </span><span style="color: #007700">= </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 /><br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$result_sql</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">$collection </span><span style="color: #007700">= </span><span style="color: #0000BB">$schema</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">createCollection</span><span style="color: #007700">(</span><span style="color: #DD0000">"humans"</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$result_collection </span><span style="color: #007700">= </span><span style="color: #0000BB">$collection</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">add</span><span style="color: #007700">(<br />  </span><span style="color: #DD0000">'{"name": "Jane",<br />    "jobs": [{"title":"Scientist","Salary":18000}, {"title":"Mother","Salary":0}],<br />    "hobbies": ["Walking","Making pies"]}'</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$result_collection_executed </span><span style="color: #007700">= </span><span style="color: #0000BB">$result_collection</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">execute</span><span style="color: #007700">();<br /><br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$result_collection</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$result_collection_executed</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

   <div class="example-contents"><p>Resultado del ejemplo anterior es similar a:</p></div>
   <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">object(mysql_xdevapi\SqlStatementResult)#3 (0) {
}

object(mysql_xdevapi\CollectionAdd)#5 (0) {
}

object(mysql_xdevapi\Result)#7 (0) {
}</pre>
</div>
   </div>
  </div>
 </div>


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