cvs: phpdoc-es / translation.xml /reference/mysqli/functions mysqli-stmt-data-seek.xml mysqli-stmt-errno.xml mysqli-stmt-error.xml
mysqli-stmt-execute.xml
| From: | Enrique Garcia Briones | Date: | Wed, 26 May 2004 20:06:04 +0000 |
| Subject: | cvs: phpdoc-es / translation.xml /reference/mysqli/functions mysqli-stmt-data-seek.xml mysqli-stmt-errno.xml mysqli-stmt-error.xml mysqli-stmt-execute.xml |
||
| Groups: | php.doc.es | ||
| Request: | Send a blank email to doc-es+get-602@lists.php.net to get a copy of this message | ||
baoengb Wed May 26 16:06:04 2004 EDT
Added files:
/phpdoc-es/reference/mysqli/functions mysqli-stmt-data-seek.xml
mysqli-stmt-errno.xml
mysqli-stmt-error.xml
mysqli-stmt-execute.xml
Modified files:
/phpdoc-es translation.xml
Log:
Traducciones
http://cvs.php.net/diff.php/phpdoc-es/translation.xml?r1=1.148&r2=1.149&ty=u Index: phpdoc-es/translation.xml diff -u phpdoc-es/translation.xml:1.148 phpdoc-es/translation.xml:1.149 --- phpdoc-es/translation.xml:1.148 Wed May 19 12:39:16 2004 +++ phpdoc-es/translation.xml Wed May 26 16:06:03 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.148 $ --> +<!-- $Revision: 1.149 $ --> <!DOCTYPE translation SYSTEM "../entities/translation.dtd"> <translation> @@ -148,15 +148,6 @@ <file name="reference/pdf/pdf-attach-file.xml" person="jtacon" type="translation" date="29.01.2004"/> - <file name="reference/mysqli/functions/mysqli-stmt-data-seek.xml" person="baoengb" - type="translation" date="02.03.2004"/> - - <file name="reference/mysqli/functions/mysqli-stmt-errno.xml" person="baoengb" - type="translation" date="02.03.2004"/> - - <file name="reference/mysqli/functions/mysqli-stmt-error.xml" person="baoengb" - type="translation" date="02.03.2004"/> - <file name="reference/mysqli/functions/mysqli-stmt-num-rows.xml" person="baoengb" type="translation" date="02.03.2004"/> @@ -168,9 +159,6 @@ <file name="language/types.xml" person="lboshell" type="review" date="15.03.2004"/> - - <file name="reference/mysqli/functions/mysqli-stmt-execute.xml" person="baoengb" - type="translation" date="16.03.2004"/> <file name="reference/mysqli/functions/mysqli-stmt-fetch.xml" person="baoengb" type="translation" date="16.03.2004"/> http://cvs.php.net/co.php/phpdoc-es/reference/mysqli/functions/mysqli-stmt-data-seek.xml?r=1.1&p=1 Index: phpdoc-es/reference/mysqli/functions/mysqli-stmt-data-seek.xml +++ phpdoc-es/reference/mysqli/functions/mysqli-stmt-data-seek.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.4 Maintainer: baoengb Status: ready --> <refentry id="function.mysqli-stmt-data-seek"> <refnamediv> <refname>mysqli_stmt_data_seek</refname> <refname>stmt->data_seek</refname> <refpurpose>Busca una fila arbitrariamente en el resultado</refpurpose> </refnamediv> <refsect1> <title>Descripción</title> <para>Estilo por procedimientos:</para> <methodsynopsis> <type>bool</type><methodname>mysqli_stmt_data_seek</methodname> <methodparam><type>objeto</type><parameter>statement</parameter></methodparam> <methodparam><type>int</type><parameter>offset</parameter></methodparam> </methodsynopsis> <para>Estilo orientado a objetos (método):</para> <classsynopsis> <ooclass><classname>stmt</classname></ooclass> <methodsynopsis> <type>bool</type> <methodname>data_seek</methodname> <methodparam><type>int</type><parameter>offset</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> La función <function>mysqli_stmt_data_seek</function> busca por una posición arbitraria en el resultado, espec&iacite;ficada por <parameter>offset</parameter> en el resultado representado por <parameter>statement</parameter>. El parámetro <parameter>offset</parameter> debe ser un valor entre cero y el número total de filas menos 1 (0..<function>mysqli_stmt_num_rows</function> - 1). </para> </refsect1> <refsect1> <title>Valores regresados</title> <para> &return.success; </para> </refsect1> <refsect1> <title>Vea también</title> <para> <function>mysqli_prepare</function> </para> </refsect1> <refsect1> <title>Ejemplos</title> <example> <title>Estilo orientado a objetos</title> <programlisting role="php"> <![CDATA[ <?php /* Open a connection */ $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $query = "SELECT Name, CountryCode FROM City ORDER BY Name"; if ($stmt = $mysqli->prepare($query)) { /* execute query */ $stmt->execute(); /* bind result variables */ $stmt->bind_result($name, $code); /* store result */ $stmt->store_result(); /* seek to row no. 400 */ $stmt->data_seek(399); /* fetch values */ $stmt->fetch(); printf ("City: %s Countrycode: %s\n", $name, $code); /* close statement */ $stmt->close(); } /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Estilo por procedimientos</title> <programlisting role="php"> <![CDATA[ <?php /* Open a connection */ $link = mysqli_connect("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $query = "SELECT Name, CountryCode FROM City ORDER BY Name"; if ($stmt = mysqli_prepare($link, $query)) { /* execute query */ mysqli_stmt_execute($stmt); /* bind result variables */ mysqli_stmt_bind_result($stmt, $name, $code); /* store result */ mysqli_stmt_store_result($stmt); /* seek to row no. 400 */ mysqli_stmt_data_seek($stmt, 399); /* fetch values */ mysqli_stmt_fetch($stmt); printf ("City: %s Countrycode: %s\n", $name, $code); /* close statement */ mysqli_stmt_close($stmt); } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> <para> Los ejemplos anteriores producirán la siguiente salida: </para> <screen> <![CDATA[ City: Benin City Countrycode: NGA ]]> </screen> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/co.php/phpdoc-es/reference/mysqli/functions/mysqli-stmt-errno.xml?r=1.1&p=1 Index: phpdoc-es/reference/mysqli/functions/mysqli-stmt-errno.xml +++ phpdoc-es/reference/mysqli/functions/mysqli-stmt-errno.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.5 Maintainer: baoengb Status: ready --> <refentry id="function.mysqli-stmt-errno"> <refnamediv> <refname>mysqli_stmt_errno</refname> <refname>mysqli_stmt->errno</refname> <refpurpose>Regresa el código de error para la llamada más reciente</refpurpose> </refnamediv> <refsect1> <title>Descripción</title> <para>Estilo por procedimientos:</para> <methodsynopsis> <type>int</type><methodname>mysqli_stmt_errno</methodname> <methodparam><type>objeto</type><parameter>stmt</parameter></methodparam> </methodsynopsis> <para>Estilo orientado a objetos (propiedad):</para> <classsynopsis> <ooclass><classname>stmt</classname></ooclass> <fieldsynopsis><type>int</type><varname>errno</varname></fieldsynopsis> </classsynopsis> <para> Para la sentencia específicada por <literal>stmt</literal>, <function>mysqli_stmt_errno</function> regresa el código de error para la función más recientemente ejecutada, que pudo ser exitosa o fallar. </para> <note> <para> Los números de los mensajes de error del cliente están listados en el archivo de encabezados <filename>errmsg.h</filename> de MySQL, Los números de los mensajes de error del servidor están listados en <filename>mysqld_error.h</filename>. En la distribución de los fuentes de MySQL puede encontrar una lista completa de los mensajes de error y los números de error en el archivo <filename>Docs/mysqld_error.txt</filename>. </para> </note> </refsect1> <refsect1> <title>Valores regresados</title> <para> Un valor de código de error. Cero significa que no ocurrió error. </para> </refsect1> <refsect1> <title>See also</title> <para> <function>mysqli_stmt_error</function>, <function>mysqli_stmt_sqlstate</function> </para> </refsect1> <refsect1> <title>Ejemplos</title> <example> <title>Estilo orientado a objetos</title> <programlisting role="php"> <![CDATA[ <?php /* Open a connection */ $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $mysqli->query("CREATE TABLE myCountry LIKE Country"); $mysqli->query("INSERT INTO myCountry SELECT * FROM Country"); $query = "SELECT Name, Code FROM myCountry ORDER BY Name"; if ($stmt = $mysqli->prepare($query)) { /* drop table */ $mysqli->query("DROP TABLE myCountry"); /* execute query */ $stmt->execute(); printf("Error: %d.\n", $stmt->errno); /* close statement */ $stmt->close(); } /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Estilo por procedimientos</title> <programlisting role="php"> <![CDATA[ <?php /* Open a connection */ $link = mysqli_connect("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } mysqli_query($link, "CREATE TABLE myCountry LIKE Country"); mysqli_query($link, "INSERT INTO myCountry SELECT * FROM Country"); $query = "SELECT Name, Code FROM myCountry ORDER BY Name"; if ($stmt = mysqli_prepare($link, $query)) { /* drop table */ mysqli_query($link, "DROP TABLE myCountry"); /* execute query */ mysqli_stmt_execute($stmt); printf("Error: %d.\n", mysqli_stmt_errno($stmt)); /* close statement */ mysqli_stmt_close($stmt); } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> <para> Los ejemplos anteriores producirán la siguiente salida: </para> <screen> <![CDATA[ Error: 1146. ]]> </screen> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/co.php/phpdoc-es/reference/mysqli/functions/mysqli-stmt-error.xml?r=1.1&p=1 Index: phpdoc-es/reference/mysqli/functions/mysqli-stmt-error.xml +++ phpdoc-es/reference/mysqli/functions/mysqli-stmt-error.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.5 Maintainer: baoengb Status: ready --> <refentry id="function.mysqli-stmt-error"> <refnamediv> <refname>mysqli_stmt_error</refname> <refname>mysqli_stmt->error</refname> <refpurpose>Regresa una descipción para el último error</refpurpose> </refnamediv> <refsect1> <title>Descripción</title> <para>Estilo por procedimientos:</para> <methodsynopsis> <type>cadena</type><methodname>mysqli_stmt_error</methodname> <methodparam><type>objeto</type><parameter>stmt</parameter></methodparam> </methodsynopsis> <para>Estilo orientado a objetos (propiedad):</para> <classsynopsis> <ooclass><classname>stmt</classname></ooclass> <fieldsynopsis><type>cadena</type><varname>error</varname></fieldsynopsis> </classsynopsis> <para> Para la sentencia específicada por <literal>stmt</literal>, <function>mysql_stmt_error</function> regresa un mensaje de error para la llamada más reciente a una sentencia SQL, que pudo ser exitosa o fallar. </para> </refsect1> <refsect1> <title>Valores regresados</title> <para> Una cadena que describe el error. Una cadena vacía si no hubo error. </para> </refsect1> <refsect1> <title>Vea también</title> <para> <function>mysqli_stmt_errno</function>, <function>mysqli_stmt_sqlstate</function> </para> </refsect1> <refsect1> <title>Ejemplos</title> <example> <title>Estilo orientado a objetos</title> <programlisting role="php"> <![CDATA[ <?php /* Open a connection */ $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $mysqli->query("CREATE TABLE myCountry LIKE Country"); $mysqli->query("INSERT INTO myCountry SELECT * FROM Country"); $query = "SELECT Name, Code FROM myCountry ORDER BY Name"; if ($stmt = $mysqli->prepare($query)) { /* drop table */ $mysqli->query("DROP TABLE myCountry"); /* execute query */ $stmt->execute(); printf("Error: %s.\n", $stmt->error); /* close statement */ $stmt->close(); } /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Estilo por procedimientos</title> <programlisting role="php"> <![CDATA[ <?php /* Open a connection */ $link = mysqli_connect("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } mysqli_query($link, "CREATE TABLE myCountry LIKE Country"); mysqli_query($link, "INSERT INTO myCountry SELECT * FROM Country"); $query = "SELECT Name, Code FROM myCountry ORDER BY Name"; if ($stmt = mysqli_prepare($link, $query)) { /* drop table */ mysqli_query($link, "DROP TABLE myCountry"); /* execute query */ mysqli_stmt_execute($stmt); printf("Error: %s.\n", mysqli_stmt_error($stmt)); /* close statement */ mysqli_stmt_close($stmt); } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> <para> Los ejemplos anteriores prdocurán la siguiente salida: </para> <screen> <![CDATA[ Error: Table 'world.myCountry' doesn't exist. ]]> </screen> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/co.php/phpdoc-es/reference/mysqli/functions/mysqli-stmt-execute.xml?r=1.1&p=1 Index: phpdoc-es/reference/mysqli/functions/mysqli-stmt-execute.xml +++ phpdoc-es/reference/mysqli/functions/mysqli-stmt-execute.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.2 Maintainer: baoengb Status: ready --> <refentry id="function.mysqli-stmt-execute"> <refnamediv> <refname>mysqli_stmt_execute</refname> <refname>stmt->execute</refname> <refpurpose>Ejecuta una consulta preparada</refpurpose> </refnamediv> <refsect1> <title>Descripción</title> <para>Estilo por procedimientos:</para> <methodsynopsis> <type>bool</type><methodname>mysqli_stmt_execute</methodname> <methodparam><type>objeto</type><parameter>stmt</parameter></methodparam> </methodsynopsis> <para>Estilo orientado a objetos (método):</para> <classsynopsis> <ooclass><classname>mysql</classname></ooclass> <methodsynopsis> <type>bool</type> <methodname>execute</methodname> <void /> </methodsynopsis> </classsynopsis> <para> La función <function>mysqli_stmt_execute</function> ejecuta una consulta que había sido previamente preparada usando la función <function>mysqli_prepare</function> representada por el objeto <parameter>stmt</parameter>. Cuando se ejecuta cualquier marcador de parámetro que exista será automáticamente remplazado con los datos apropiados. </para> <para> Si la sentencia es UPDATE, DELETE, o INSERT, el número total de filas afectadas puede ser determinada usabdo la función <function>mysqli_stmt_affected_rows</function>. Asimismo, si la consulta produce un resultado la función <function>mysqli_fetch</function> es usada. </para> <note> <para> Cuando se usa <function>mysqli_stmt_execute</function>, la función <function>mysqli_fetch</function> debe ser usada para recuperar los datos antes de realizar cualquier consulta adicional. </para> </note> </refsect1> <refsect1> <title>Valores regresados</title> <para>&return.success;</para> </refsect1> <refsect1> <title>Vea también</title> <para> <function>mysqli_prepare</function> <function>mysqli_stmt_bind_param</function>. </para> </refsect1> <refsect1> <title>Ejemplos</title> <example> <title>Estilo orientado a objetos</title> <programlisting role="php"> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $mysqli->query("CREATE TABLE myCity LIKE City"); /* Prepare an insert statement */ $query = "INSERT INTO myCity (Name, CountryCode, District) VALUES (?,?,?)"; $stmt = $mysqli->prepare($query); $stmt->bind_param("sss", $val1, $val2, $val3); $val1 = 'Stuttgart'; $val2 = 'DEU'; $val3 = 'Baden-Wuerttemberg'; /* Execute the statement */ $stmt->execute(); $val1 = 'Bordeaux'; $val2 = 'FRA'; $val3 = 'Aquitaine'; /* Execute the statement */ $stmt->execute(); /* close statement */ $stmt->close(); /* retrieve all rows from myCity */ $query = "SELECT Name, CountryCode, District FROM myCity"; if ($result = $mysqli->query($query)) { while ($row = $result->fetch_row()) { printf("%s (%s,%s)\n", $row[0], $row[1], $row[2]); } /* free result set */ $result->close(); } /* remove table */ $mysqli->query("DROP TABLE myCity"); /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Estilo por procedimientos</title> <programlisting role="php"> <![CDATA[ <?php $link = mysqli_connect("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } mysqli_query($link, "CREATE TABLE myCity LIKE City"); /* Prepare an insert statement */ $query = "INSERT INTO myCity (Name, CountryCode, District) VALUES (?,?,?)"; $stmt = mysqli_prepare($link, $query); mysqli_stmt_bind_param($stmt, "sss", $val1, $val2, $val3); $val1 = 'Stuttgart'; $val2 = 'DEU'; $val3 = 'Baden-Wuerttemberg'; /* Execute the statement */ mysqli_stmt_execute($stmt); $val1 = 'Bordeaux'; $val2 = 'FRA'; $val3 = 'Aquitaine'; /* Execute the statement */ mysqli_stmt_execute($stmt); /* close statement */ mysqli_stmt_close($stmt); /* retrieve all rows from myCity */ $query = "SELECT Name, CountryCode, District FROM myCity"; if ($result = mysqli_query($link, $query)) { while ($row = mysqli_fetch_row($result)) { printf("%s (%s,%s)\n", $row[0], $row[1], $row[2]); } /* free result set */ mysqli_free_result($result); } /* remove table */ mysqli_query($link, "DROP TABLE myCity"); /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> <para> Los ejemplos anteriores producirán la siguiente salida: </para> <screen> <![CDATA[ Stuttgart (DEU,Baden-Wuerttemberg) Bordeaux (FRA,Aquitaine) ]]> </screen> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->
http://cvs.php.net/diff.php/phpdoc-es/translation.xml?r1=1.148&r2=1.149&ty=u Index: phpdoc-es/translation.xml diff -u phpdoc-es/translation.xml:1.148 phpdoc-es/translation.xml:1.149 --- phpdoc-es/translation.xml:1.148 Wed May 19 12:39:16 2004 +++ phpdoc-es/translation.xml Wed May 26 16:06:03 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.148 $ --> +<!-- $Revision: 1.149 $ --> <!DOCTYPE translation SYSTEM "../entities/translation.dtd"> <translation> @@ -148,15 +148,6 @@ <file name="reference/pdf/pdf-attach-file.xml" person="jtacon" type="translation" date="29.01.2004"/> - <file name="reference/mysqli/functions/mysqli-stmt-data-seek.xml" person="baoengb" - type="translation" date="02.03.2004"/> - - <file name="reference/mysqli/functions/mysqli-stmt-errno.xml" person="baoengb" - type="translation" date="02.03.2004"/> - - <file name="reference/mysqli/functions/mysqli-stmt-error.xml" person="baoengb" - type="translation" date="02.03.2004"/> - <file name="reference/mysqli/functions/mysqli-stmt-num-rows.xml" person="baoengb" type="translation" date="02.03.2004"/> @@ -168,9 +159,6 @@ <file name="language/types.xml" person="lboshell" type="review" date="15.03.2004"/> - - <file name="reference/mysqli/functions/mysqli-stmt-execute.xml" person="baoengb" - type="translation" date="16.03.2004"/> <file name="reference/mysqli/functions/mysqli-stmt-fetch.xml" person="baoengb" type="translation" date="16.03.2004"/> http://cvs.php.net/co.php/phpdoc-es/reference/mysqli/functions/mysqli-stmt-data-seek.xml?r=1.1&p=1 Index: phpdoc-es/reference/mysqli/functions/mysqli-stmt-data-seek.xml +++ phpdoc-es/reference/mysqli/functions/mysqli-stmt-data-seek.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.4 Maintainer: baoengb Status: ready --> <refentry id="function.mysqli-stmt-data-seek"> <refnamediv> <refname>mysqli_stmt_data_seek</refname> <refname>stmt->data_seek</refname> <refpurpose>Busca una fila arbitrariamente en el resultado</refpurpose> </refnamediv> <refsect1> <title>Descripción</title> <para>Estilo por procedimientos:</para> <methodsynopsis> <type>bool</type><methodname>mysqli_stmt_data_seek</methodname> <methodparam><type>objeto</type><parameter>statement</parameter></methodparam> <methodparam><type>int</type><parameter>offset</parameter></methodparam> </methodsynopsis> <para>Estilo orientado a objetos (método):</para> <classsynopsis> <ooclass><classname>stmt</classname></ooclass> <methodsynopsis> <type>bool</type> <methodname>data_seek</methodname> <methodparam><type>int</type><parameter>offset</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> La función <function>mysqli_stmt_data_seek</function> busca por una posición arbitraria en el resultado, espec&iacite;ficada por <parameter>offset</parameter> en el resultado representado por <parameter>statement</parameter>. El parámetro <parameter>offset</parameter> debe ser un valor entre cero y el número total de filas menos 1 (0..<function>mysqli_stmt_num_rows</function> - 1). </para> </refsect1> <refsect1> <title>Valores regresados</title> <para> &return.success; </para> </refsect1> <refsect1> <title>Vea también</title> <para> <function>mysqli_prepare</function> </para> </refsect1> <refsect1> <title>Ejemplos</title> <example> <title>Estilo orientado a objetos</title> <programlisting role="php"> <![CDATA[ <?php /* Open a connection */ $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $query = "SELECT Name, CountryCode FROM City ORDER BY Name"; if ($stmt = $mysqli->prepare($query)) { /* execute query */ $stmt->execute(); /* bind result variables */ $stmt->bind_result($name, $code); /* store result */ $stmt->store_result(); /* seek to row no. 400 */ $stmt->data_seek(399); /* fetch values */ $stmt->fetch(); printf ("City: %s Countrycode: %s\n", $name, $code); /* close statement */ $stmt->close(); } /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Estilo por procedimientos</title> <programlisting role="php"> <![CDATA[ <?php /* Open a connection */ $link = mysqli_connect("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $query = "SELECT Name, CountryCode FROM City ORDER BY Name"; if ($stmt = mysqli_prepare($link, $query)) { /* execute query */ mysqli_stmt_execute($stmt); /* bind result variables */ mysqli_stmt_bind_result($stmt, $name, $code); /* store result */ mysqli_stmt_store_result($stmt); /* seek to row no. 400 */ mysqli_stmt_data_seek($stmt, 399); /* fetch values */ mysqli_stmt_fetch($stmt); printf ("City: %s Countrycode: %s\n", $name, $code); /* close statement */ mysqli_stmt_close($stmt); } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> <para> Los ejemplos anteriores producirán la siguiente salida: </para> <screen> <![CDATA[ City: Benin City Countrycode: NGA ]]> </screen> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/co.php/phpdoc-es/reference/mysqli/functions/mysqli-stmt-errno.xml?r=1.1&p=1 Index: phpdoc-es/reference/mysqli/functions/mysqli-stmt-errno.xml +++ phpdoc-es/reference/mysqli/functions/mysqli-stmt-errno.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.5 Maintainer: baoengb Status: ready --> <refentry id="function.mysqli-stmt-errno"> <refnamediv> <refname>mysqli_stmt_errno</refname> <refname>mysqli_stmt->errno</refname> <refpurpose>Regresa el código de error para la llamada más reciente</refpurpose> </refnamediv> <refsect1> <title>Descripción</title> <para>Estilo por procedimientos:</para> <methodsynopsis> <type>int</type><methodname>mysqli_stmt_errno</methodname> <methodparam><type>objeto</type><parameter>stmt</parameter></methodparam> </methodsynopsis> <para>Estilo orientado a objetos (propiedad):</para> <classsynopsis> <ooclass><classname>stmt</classname></ooclass> <fieldsynopsis><type>int</type><varname>errno</varname></fieldsynopsis> </classsynopsis> <para> Para la sentencia específicada por <literal>stmt</literal>, <function>mysqli_stmt_errno</function> regresa el código de error para la función más recientemente ejecutada, que pudo ser exitosa o fallar. </para> <note> <para> Los números de los mensajes de error del cliente están listados en el archivo de encabezados <filename>errmsg.h</filename> de MySQL, Los números de los mensajes de error del servidor están listados en <filename>mysqld_error.h</filename>. En la distribución de los fuentes de MySQL puede encontrar una lista completa de los mensajes de error y los números de error en el archivo <filename>Docs/mysqld_error.txt</filename>. </para> </note> </refsect1> <refsect1> <title>Valores regresados</title> <para> Un valor de código de error. Cero significa que no ocurrió error. </para> </refsect1> <refsect1> <title>See also</title> <para> <function>mysqli_stmt_error</function>, <function>mysqli_stmt_sqlstate</function> </para> </refsect1> <refsect1> <title>Ejemplos</title> <example> <title>Estilo orientado a objetos</title> <programlisting role="php"> <![CDATA[ <?php /* Open a connection */ $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $mysqli->query("CREATE TABLE myCountry LIKE Country"); $mysqli->query("INSERT INTO myCountry SELECT * FROM Country"); $query = "SELECT Name, Code FROM myCountry ORDER BY Name"; if ($stmt = $mysqli->prepare($query)) { /* drop table */ $mysqli->query("DROP TABLE myCountry"); /* execute query */ $stmt->execute(); printf("Error: %d.\n", $stmt->errno); /* close statement */ $stmt->close(); } /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Estilo por procedimientos</title> <programlisting role="php"> <![CDATA[ <?php /* Open a connection */ $link = mysqli_connect("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } mysqli_query($link, "CREATE TABLE myCountry LIKE Country"); mysqli_query($link, "INSERT INTO myCountry SELECT * FROM Country"); $query = "SELECT Name, Code FROM myCountry ORDER BY Name"; if ($stmt = mysqli_prepare($link, $query)) { /* drop table */ mysqli_query($link, "DROP TABLE myCountry"); /* execute query */ mysqli_stmt_execute($stmt); printf("Error: %d.\n", mysqli_stmt_errno($stmt)); /* close statement */ mysqli_stmt_close($stmt); } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> <para> Los ejemplos anteriores producirán la siguiente salida: </para> <screen> <![CDATA[ Error: 1146. ]]> </screen> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/co.php/phpdoc-es/reference/mysqli/functions/mysqli-stmt-error.xml?r=1.1&p=1 Index: phpdoc-es/reference/mysqli/functions/mysqli-stmt-error.xml +++ phpdoc-es/reference/mysqli/functions/mysqli-stmt-error.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.5 Maintainer: baoengb Status: ready --> <refentry id="function.mysqli-stmt-error"> <refnamediv> <refname>mysqli_stmt_error</refname> <refname>mysqli_stmt->error</refname> <refpurpose>Regresa una descipción para el último error</refpurpose> </refnamediv> <refsect1> <title>Descripción</title> <para>Estilo por procedimientos:</para> <methodsynopsis> <type>cadena</type><methodname>mysqli_stmt_error</methodname> <methodparam><type>objeto</type><parameter>stmt</parameter></methodparam> </methodsynopsis> <para>Estilo orientado a objetos (propiedad):</para> <classsynopsis> <ooclass><classname>stmt</classname></ooclass> <fieldsynopsis><type>cadena</type><varname>error</varname></fieldsynopsis> </classsynopsis> <para> Para la sentencia específicada por <literal>stmt</literal>, <function>mysql_stmt_error</function> regresa un mensaje de error para la llamada más reciente a una sentencia SQL, que pudo ser exitosa o fallar. </para> </refsect1> <refsect1> <title>Valores regresados</title> <para> Una cadena que describe el error. Una cadena vacía si no hubo error. </para> </refsect1> <refsect1> <title>Vea también</title> <para> <function>mysqli_stmt_errno</function>, <function>mysqli_stmt_sqlstate</function> </para> </refsect1> <refsect1> <title>Ejemplos</title> <example> <title>Estilo orientado a objetos</title> <programlisting role="php"> <![CDATA[ <?php /* Open a connection */ $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $mysqli->query("CREATE TABLE myCountry LIKE Country"); $mysqli->query("INSERT INTO myCountry SELECT * FROM Country"); $query = "SELECT Name, Code FROM myCountry ORDER BY Name"; if ($stmt = $mysqli->prepare($query)) { /* drop table */ $mysqli->query("DROP TABLE myCountry"); /* execute query */ $stmt->execute(); printf("Error: %s.\n", $stmt->error); /* close statement */ $stmt->close(); } /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Estilo por procedimientos</title> <programlisting role="php"> <![CDATA[ <?php /* Open a connection */ $link = mysqli_connect("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } mysqli_query($link, "CREATE TABLE myCountry LIKE Country"); mysqli_query($link, "INSERT INTO myCountry SELECT * FROM Country"); $query = "SELECT Name, Code FROM myCountry ORDER BY Name"; if ($stmt = mysqli_prepare($link, $query)) { /* drop table */ mysqli_query($link, "DROP TABLE myCountry"); /* execute query */ mysqli_stmt_execute($stmt); printf("Error: %s.\n", mysqli_stmt_error($stmt)); /* close statement */ mysqli_stmt_close($stmt); } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> <para> Los ejemplos anteriores prdocurán la siguiente salida: </para> <screen> <![CDATA[ Error: Table 'world.myCountry' doesn't exist. ]]> </screen> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/co.php/phpdoc-es/reference/mysqli/functions/mysqli-stmt-execute.xml?r=1.1&p=1 Index: phpdoc-es/reference/mysqli/functions/mysqli-stmt-execute.xml +++ phpdoc-es/reference/mysqli/functions/mysqli-stmt-execute.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.2 Maintainer: baoengb Status: ready --> <refentry id="function.mysqli-stmt-execute"> <refnamediv> <refname>mysqli_stmt_execute</refname> <refname>stmt->execute</refname> <refpurpose>Ejecuta una consulta preparada</refpurpose> </refnamediv> <refsect1> <title>Descripción</title> <para>Estilo por procedimientos:</para> <methodsynopsis> <type>bool</type><methodname>mysqli_stmt_execute</methodname> <methodparam><type>objeto</type><parameter>stmt</parameter></methodparam> </methodsynopsis> <para>Estilo orientado a objetos (método):</para> <classsynopsis> <ooclass><classname>mysql</classname></ooclass> <methodsynopsis> <type>bool</type> <methodname>execute</methodname> <void /> </methodsynopsis> </classsynopsis> <para> La función <function>mysqli_stmt_execute</function> ejecuta una consulta que había sido previamente preparada usando la función <function>mysqli_prepare</function> representada por el objeto <parameter>stmt</parameter>. Cuando se ejecuta cualquier marcador de parámetro que exista será automáticamente remplazado con los datos apropiados. </para> <para> Si la sentencia es UPDATE, DELETE, o INSERT, el número total de filas afectadas puede ser determinada usabdo la función <function>mysqli_stmt_affected_rows</function>. Asimismo, si la consulta produce un resultado la función <function>mysqli_fetch</function> es usada. </para> <note> <para> Cuando se usa <function>mysqli_stmt_execute</function>, la función <function>mysqli_fetch</function> debe ser usada para recuperar los datos antes de realizar cualquier consulta adicional. </para> </note> </refsect1> <refsect1> <title>Valores regresados</title> <para>&return.success;</para> </refsect1> <refsect1> <title>Vea también</title> <para> <function>mysqli_prepare</function> <function>mysqli_stmt_bind_param</function>. </para> </refsect1> <refsect1> <title>Ejemplos</title> <example> <title>Estilo orientado a objetos</title> <programlisting role="php"> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $mysqli->query("CREATE TABLE myCity LIKE City"); /* Prepare an insert statement */ $query = "INSERT INTO myCity (Name, CountryCode, District) VALUES (?,?,?)"; $stmt = $mysqli->prepare($query); $stmt->bind_param("sss", $val1, $val2, $val3); $val1 = 'Stuttgart'; $val2 = 'DEU'; $val3 = 'Baden-Wuerttemberg'; /* Execute the statement */ $stmt->execute(); $val1 = 'Bordeaux'; $val2 = 'FRA'; $val3 = 'Aquitaine'; /* Execute the statement */ $stmt->execute(); /* close statement */ $stmt->close(); /* retrieve all rows from myCity */ $query = "SELECT Name, CountryCode, District FROM myCity"; if ($result = $mysqli->query($query)) { while ($row = $result->fetch_row()) { printf("%s (%s,%s)\n", $row[0], $row[1], $row[2]); } /* free result set */ $result->close(); } /* remove table */ $mysqli->query("DROP TABLE myCity"); /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Estilo por procedimientos</title> <programlisting role="php"> <![CDATA[ <?php $link = mysqli_connect("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } mysqli_query($link, "CREATE TABLE myCity LIKE City"); /* Prepare an insert statement */ $query = "INSERT INTO myCity (Name, CountryCode, District) VALUES (?,?,?)"; $stmt = mysqli_prepare($link, $query); mysqli_stmt_bind_param($stmt, "sss", $val1, $val2, $val3); $val1 = 'Stuttgart'; $val2 = 'DEU'; $val3 = 'Baden-Wuerttemberg'; /* Execute the statement */ mysqli_stmt_execute($stmt); $val1 = 'Bordeaux'; $val2 = 'FRA'; $val3 = 'Aquitaine'; /* Execute the statement */ mysqli_stmt_execute($stmt); /* close statement */ mysqli_stmt_close($stmt); /* retrieve all rows from myCity */ $query = "SELECT Name, CountryCode, District FROM myCity"; if ($result = mysqli_query($link, $query)) { while ($row = mysqli_fetch_row($result)) { printf("%s (%s,%s)\n", $row[0], $row[1], $row[2]); } /* free result set */ mysqli_free_result($result); } /* remove table */ mysqli_query($link, "DROP TABLE myCity"); /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> <para> Los ejemplos anteriores producirán la siguiente salida: </para> <screen> <![CDATA[ Stuttgart (DEU,Baden-Wuerttemberg) Bordeaux (FRA,Aquitaine) ]]> </screen> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->