cvs: phpdoc-es / translation.xml /reference/mysqli/functions mysqli-stmt-affected-rows.xml mysqli-stmt-bind-param.xml mysqli-stmt-bind-result.xml
mysqli-stmt-close.xml

From: Date: Wed, 19 May 2004 16:39:16 +0000
Subject: cvs: phpdoc-es / translation.xml /reference/mysqli/functions mysqli-stmt-affected-rows.xml mysqli-stmt-bind-param.xml mysqli-stmt-bind-result.xml
mysqli-stmt-close.xml
Groups: php.doc.es 
Request: Send a blank email to doc-es+get-594@lists.php.net to get a copy of this message
baoengb Wed May 19 12:39:16 2004 EDT Added files: /phpdoc-es/reference/mysqli/functions mysqli-stmt-affected-rows.xml mysqli-stmt-bind-param.xml mysqli-stmt-bind-result.xml mysqli-stmt-close.xml Modified files: /phpdoc-es translation.xml Log: Traducciones

http://cvs.php.net/diff.php/phpdoc-es/translation.xml?r1=1.147&r2=1.148&ty=u Index: phpdoc-es/translation.xml diff -u phpdoc-es/translation.xml:1.147 phpdoc-es/translation.xml:1.148 --- phpdoc-es/translation.xml:1.147 Wed May 12 13:59:48 2004 +++ phpdoc-es/translation.xml Wed May 19 12:39:16 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.147 $ --> +<!-- $Revision: 1.148 $ --> <!DOCTYPE translation SYSTEM "../entities/translation.dtd"> <translation> @@ -148,12 +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-affected-rows.xml" person="baoengb" - type="translation" date="02.03.2004"/> - - <file name="reference/mysqli/functions/mysqli-stmt-close.xml" person="baoengb" - type="translation" date="02.03.2004"/> - <file name="reference/mysqli/functions/mysqli-stmt-data-seek.xml" person="baoengb" type="translation" date="02.03.2004"/> @@ -175,12 +169,6 @@ <file name="language/types.xml" person="lboshell" type="review" date="15.03.2004"/> - <file name="reference/mysqli/functions/mysqli-stmt-bind-param.xml" person="baoengb" - type="translation" date="16.03.2004"/> - - <file name="reference/mysqli/functions/mysqli-stmt-bind-result.xml" person="baoengb" - type="translation" date="16.03.2004"/> - <file name="reference/mysqli/functions/mysqli-stmt-execute.xml" person="baoengb" type="translation" date="16.03.2004"/> http://cvs.php.net/co.php/phpdoc-es/reference/mysqli/functions/mysqli-stmt-affected-rows.xml?r=1.1&p=1 Index: phpdoc-es/reference/mysqli/functions/mysqli-stmt-affected-rows.xml +++ phpdoc-es/reference/mysqli/functions/mysqli-stmt-affected-rows.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-affected-rows"> <refnamediv> <refname>mysqli_stmt_affected_rows</refname> <refname>mysqli_stmt->affected_rows</refname> <refpurpose>Regresa el n&uacute;mero total de filas cambiadas, borradas o insertadas por la &uacute;ltima sentencia ejecutada </refpurpose> </refnamediv> <refsect1> <title>Descripci&oacute;n</title> <para>Estilo por procedimientos :</para> <methodsynopsis> <type>mixto</type><methodname>mysqli_stmt_affected_rows</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>mixto</type><varname>affected_rows</varname></fieldsynopsis> </classsynopsis> <para> <function>mysqli_stmt_affected_rows</function> regresa el n&uacute;mero de filas afectadas por consultas INSERT, UPDATE o DELETE. Si la &uacute;ltima consulta fue invalida, esta funci&oacute;n regresar&aacute; -1 </para> <para> La funci&oacute;n <function>mysqli_stmt_affected_rows</function> solo funciona con consultas que actualizan tablas. Para obtener el n&uacute;mero de filas de una consulta SELECT, use la funci&oacute;n <function>mysqli_stmt_num_rows</function>. </para> </refsect1> <refsect1> <title>Valores regresados</title> <para> Un entero mayor a cero indica el n&uacute;mero de filas afectadas u obtenidas. Cero indica que no hubo registros actualizados para sentencias UPDATE/DELETE, no hubo filas que concordaran la cl&aacute;usula WHERE en la consulta o que no se ha ejecutado ninguna consulta todav&iacute;a. -1 indifca que la consulta ha regresado un error. </para> <note> <para> Si el n&uacute;mero de filas afectadas es mayor que el valor entero maximo de PHP, el n&uacute;mero de filas afectadas ser&aacute; regresada como una cadena. </para> </note> </refsect1> <refsect1> <title>Vea tambi&eacute;n</title> <para> <function>mysqli_stmt_num_rows</function>, <function>mysqli_prepare</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(); } /* create temp table */ $mysqli->query("CREATE TEMPORARY TABLE myCountry LIKE Country"); $query = "INSERT INTO myCountry SELECT * FROM Country WHERE Code LIKE ?"; /* prepare statement */ if ($stmt = $mysqli->prepare($query)) { /* Bind variable for placeholder */ $code = 'A%'; $stmt->bind_param("s", $code); /* execute statement */ $stmt->execute(); printf("rows inserted: %d\n", $stmt->affected_rows); /* close statement */ $stmt->close(); } /* 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(); } /* create temp table */ mysqli_query($link, "CREATE TEMPORARY TABLE myCountry LIKE Country"); $query = "INSERT INTO myCountry SELECT * FROM Country WHERE Code LIKE ?"; /* prepare statement */ if ($stmt = mysqli_prepare($link, $query)) { /* Bind variable for placeholder */ $code = 'A%'; mysqli_stmt_bind_param($stmt, "s", $code); /* execute statement */ mysqli_stmt_execute($stmt); printf("rows inserted: %d\n", mysqli_stmt_affected_rows($stmt)); /* close statement */ mysqli_stmt_close($stmt); } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> <para> Los ejemplos anteriores producir&aacute;n la siguiente salida: </para> <screen> <![CDATA[ rows inserted: 17 ]]> </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-bind-param.xml?r=1.1&p=1 Index: phpdoc-es/reference/mysqli/functions/mysqli-stmt-bind-param.xml +++ phpdoc-es/reference/mysqli/functions/mysqli-stmt-bind-param.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.3 Maintainer: baoengb Status: ready --> <refentry id="function.mysqli-stmt-bind-param"> <refnamediv> <refname>mysqli_stmt_bind_param</refname> <refname>stmt->bind_param</refname> <refpurpose>Enlaza variables como par&aacute;metros a una sentencia preparada</refpurpose> </refnamediv> <refsect1> <title>Descripci&oacute;n</title> <para>Estilo por procedimientos:</para> <methodsynopsis> <type>bool</type><methodname>mysqli_stmt_bind_param</methodname> <methodparam><type>objeto</type><parameter>stmt</parameter></methodparam> <methodparam><type>cadena</type><parameter>types</parameter></methodparam> <methodparam><type>mixto</type><parameter>var1</parameter></methodparam> <methodparam choice="opt"><type>mixto</type><parameter>var2, ...</parameter></methodparam> </methodsynopsis> <para>Estilo orientado a objetos (m&eacute;todo):</para> <classsynopsis> <ooclass><classname>stmt</classname></ooclass> <methodsynopsis> <type>bool</type> <methodname>bind_param</methodname> <methodparam><type>matriz</type><parameter>types</parameter></methodparam> <methodparam><type>mixto</type><parameter>var1</parameter></methodparam> <methodparam choice="opt"><type>mixto</type><parameter>var2, ...</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> <function>mysqli_stmt_bind_param</function> es usada para enlazar variables para los marcadores de par&aacute;metros en la sentencia SQL que fue pasada a <function>mysql_prepare</function>. La cadena <parameter>types</parameter> contiene uno o m&aacute;s caracteres los cuales especifican los tipos para las variables enlazadas correspondientes. <table> <title>Especificaci&oacute;n de caracteres de tipo</title> <tgroup cols='2'> <thead> <row> <entry>Caracter</entry> <entry>Descripci&oacute;n</entry> </row> </thead> <tbody> <row> <entry>i</entry> <entry>La variable correspondiente tiene tipo entero</entry> </row> <row> <entry>d</entry> <entry>La variable correspondiente tiene tipo doble</entry> </row> <row> <entry>s</entry> <entry>La variable correspondiente tiene tipo cadena</entry> </row> <row> <entry>b</entry> <entry>La variable correspondiente tiene tipo BLOB y ser&aacute; enviada en paquetes</entry> </row> </tbody> </tgroup> </table> </para> <note> <para> Si el tama&ntilde;o de los datos de la variable exceden el tama&ntilde;o maximo permitido para un paquete (max_allowed_package), tienes que espec&iacute;ficar <literal>b</literal> en <parameter>types</parameter> y usar <function>mysqli_stmt_send_long_data</function> para enviar los datos en paquetes. </para> <para> El n&uacute;mero de variables y longitud de la cadena <parameter>types</parameter> debe coincidir los par&aacute;metros en la sentencia. </para> </note> </refsect1> <refsect1> <title>Valores regresados</title> <para> &return.success; </para> </refsect1> <refsect1> <title>Vea tambi&eacute;n</title> <para> <function>mysqli_stmt_bind_result</function>, <function>mysqli_stmt_execute</function>, <function>mysqli_stmt_fetch</function>, <function>mysqli_prepare</function>, <function>mysqli_stmt_send_long_data</function>, <function>mysqli_stmt_errno</function>, <function>mysqli_stmt_error</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(); } $stmt = $mysqli->prepare("INSERT INTO CountryLanguage VALUES (?, ?, ?, ?)"); $stmt->bind_param('sssd', $code, $language, $official, $percent); $code = 'DEU'; $language = 'Bavarian'; $official = "F"; $percent = 11.2; /* execute prepared statement */ $stmt->execute(); printf("%d Row inserted.\n", $stmt->affected_rows); /* close statement and connection */ $stmt->close(); /* Clean up table CountryLanguage */ $mysqli->query("DELETE FROM CountryLanguage WHERE Language='Bavarian'"); printf("%d Row deleted.\n", $mysqli->affected_rows); /* 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 (!$link) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $stmt = mysqli_prepare($link, "INSERT INTO CountryLanguage VALUES (?, ?, ?, ?)"); mysqli_stmt_bind_param($stmt, 'sssd', $code, $language, $official, $percent); $code = 'DEU'; $language = 'Bavarian'; $official = "F"; $percent = 11.2; /* execute prepared statement */ mysqi_stmt_execute($stmt); printf("%d Row inserted.\n", mysqli_stmt_affected_rows($stmt)); /* close statement and connection */ mysqli_stmt_close($stmt); /* Clean up table CountryLanguage */ mysqli_query($link, "DELETE FROM CountryLanguage WHERE Language='Bavarian'"); printf("%d Row deleted.\n", mysqli_affected_rows($link)); /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> <para> Los ejemplos anteriores producir&aacute;n la siguiente salida: </para> <screen> <![CDATA[ 1 Row inserted. 1 Row deleted. ]]> </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-bind-result.xml?r=1.1&p=1 Index: phpdoc-es/reference/mysqli/functions/mysqli-stmt-bind-result.xml +++ phpdoc-es/reference/mysqli/functions/mysqli-stmt-bind-result.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: baoengb Status: ready --> <refentry id="function.mysqli-stmt-bind-result"> <refnamediv> <refname>mysqli_stmt_bind_result</refname> <refname>stmt->bind_result</refname> <refpurpose>Enlaza variables a una sentencia preparada para el almacenamiento del resultado</refpurpose> </refnamediv> <refsect1> <title>Descripci&oacute;n</title> <para>Estilo por procedimientos:</para> <methodsynopsis> <type>bool</type><methodname>mysqli_stnt_bind_result</methodname> <methodparam><type>objeto</type><parameter>stmt</parameter></methodparam> <methodparam><type>mixto</type><parameter>var1</parameter></methodparam> <methodparam choice="opt"><type>mixto</type><parameter>var2, ...</parameter></methodparam> </methodsynopsis> <para>Estilo orientado a objetos (m&eacute;todo):</para> <classsynopsis> <ooclass><classname>stmt</classname></ooclass> <methodsynopsis> <type>bool</type> <methodname>bind_result</methodname> <methodparam><type>mixto</type><parameter>var1</parameter></methodparam> <methodparam choice="opt"><type>mixto</type><parameter>var2, ...</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> <function>mysqli_stmt_bind_result</function> es usada para asociar (enlazar) columnas en el resultado a variables. Cuando <function>mysqli_stmt_fetch</function> es llamada para obtener datos, el protocolo cliente/servidor de MySQL coloca los datos para las columnas delimitadas en las variables espec&iacute;ficadas en <parameter>var1, ...</parameter>. </para> <note> <para> Note que todas las columnas deben estar delimitadas antes de llamar <function>mysqli_stmt_fetch</function>. Dependiendo en los tipos de columnas a las variables delimitadas pueden silenciosamente cambiar al tipo correspondiente en PHP. </para> <para> Una columna puede ser delimitada o re-delimitada en cualquier momento, a&uacute;n despues de que se ha recuperado parcialmente un resultado. La nueva delimitaci&oacute;n toma efecto la siguiente vez que <function>mysqli_stmt_fetch</function> es llamada. </para> </note> </refsect1> <refsect1> <title>Valores regresados</title> <para> &return.success; </para> </refsect1> <refsect1> <title>Vea tambi&eacute;n</title> <para> <function>mysqli_stmt_bind_param</function>, <function>mysqli_stmt_execute</function>, <function>mysqli_stmt_fetch</function>, <function>mysqli_prepare</function>, <function>mysqli_stmt_prepare</function>, <function>mysqli_stmt_init</function>, <function>mysqli_stmt_errno</function>, <function>mysqli_stmt_error</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"); if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } /* prepare statement */ if ($stmt = $mysqli->prepare("SELECT Code, Name FROM Country ORDER BY Name LIMIT 5")) { $stmt->execute(); /* bind variables to prepared statement */ $stmt->bind_result($col1, $col2); /* fetch values */ while ($stmt->fetch()) { printf("%s %s\n", $col1, $col2); } /* close statement */ $stmt->close(); } /* 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 (!$link) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } /* prepare statement */ if ($stmt = mysqli_prepare($link, "SELECT Code, Name FROM Country ORDER BY Name LIMIT 5")) { mysqli_stmt_execute($stmt); /* bind variables to prepared statement */ mysqli_stmt_bind_result($stmt, $col1, $col2); /* fetch values */ while (mysqli_stmt_fetch($stmt)) { printf("%s %s\n", $col1, $col2); } /* close statement */ mysqli_stmt_close($stmt); } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> <para> Los ejemplos anteriores producir&aacute;n la siguiente salida: </para> <screen> <![CDATA[ AFG Afghanistan ALB Albania DZA Algeria ASM American Samoa AND Andorra ]]> </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-close.xml?r=1.1&p=1 Index: phpdoc-es/reference/mysqli/functions/mysqli-stmt-close.xml +++ phpdoc-es/reference/mysqli/functions/mysqli-stmt-close.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-close"> <refnamediv> <refname>mysqli_stmt_close</refname> <refname>mysqli_stmt->close</refname> <refpurpose>Cierra la sentencia preparada</refpurpose> </refnamediv> <refsect1> <title>Descripci&oacute;n</title> <para>Estilo por procedimientos:</para> <methodsynopsis> <type>bool</type><methodname>mysqli_stmt_close</methodname> <methodparam><type>objeto</type><parameter>stmt</parameter></methodparam> </methodsynopsis> <para>Estilo orientado a objetos (m&eacute;todo):</para> <classsynopsis> <ooclass><classname>mysqli_stmt</classname></ooclass> <methodsynopsis> <type>bool</type><methodname>mysqli_stmt->close</methodname> <void /> </methodsynopsis> </classsynopsis> <para> Cierra una sentencia preparada. <function>mysql_stmt_close</function> tambi&eacute;n desaloja el manejador de sentencias apuntado por <parameter>stmt</parameter>. Si la sentencia actual tiene resultados pendientes o no le&iacute;dos, esta funci&oacute;n los cancela de tal manera que la siguiente consulta pueda ser ejecutada. </para> </refsect1> <refsect1> <title>Valores regresados</title> <para>&return.success;</para> </refsect1> <refsect1> <title>Vea tambi&eacute;n</title> <para> <function>mysqli_prepare</function>, </para> </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 -->
« previous php.doc.es (#594) next »