cvs: phpdoc-es / translation.xml /reference/mysqli/functions mysqli-next-result.xml mysqli-num-fields.xml mysqli-num-rows.xml mysqli-options.xml
mysqli-param-count.xml mysqli-ping.xml mysqli-prepare.xml

From: Date: Mon, 26 Apr 2004 17:38:21 +0000
Subject: cvs: phpdoc-es / translation.xml /reference/mysqli/functions mysqli-next-result.xml mysqli-num-fields.xml mysqli-num-rows.xml mysqli-options.xml
mysqli-param-count.xml mysqli-ping.xml mysqli-prepare.xml
Groups: php.doc.es 
Request: Send a blank email to doc-es+get-574@lists.php.net to get a copy of this message
baoengb Mon Apr 26 13:38:21 2004 EDT Added files: /phpdoc-es/reference/mysqli/functions mysqli-next-result.xml mysqli-num-fields.xml mysqli-num-rows.xml mysqli-options.xml mysqli-param-count.xml mysqli-ping.xml mysqli-prepare.xml Modified files: /phpdoc-es translation.xml Log: Agregando a la traduccion al espanyiol

http://cvs.php.net/diff.php/phpdoc-es/translation.xml?r1=1.143&r2=1.144&ty=u Index: phpdoc-es/translation.xml diff -u phpdoc-es/translation.xml:1.143 phpdoc-es/translation.xml:1.144 --- phpdoc-es/translation.xml:1.143 Thu Apr 22 12:21:38 2004 +++ phpdoc-es/translation.xml Mon Apr 26 13:38:20 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.143 $ --> +<!-- $Revision: 1.144 $ --> <!DOCTYPE translation SYSTEM "../entities/translation.dtd"> <translation> @@ -148,27 +148,6 @@ <file name="reference/pdf/pdf-attach-file.xml" person="jtacon" type="translation" date="29.01.2004"/> - <file name="reference/mysqli/functions/mysqli-next-result.xml" person="baoengb" - type="translation" date="02.03.2004"/> - - <file name="reference/mysqli/functions/mysqli-num-fields.xml" person="baoengb" - type="translation" date="02.03.2004"/> - - <file name="reference/mysqli/functions/mysqli-num-rows.xml" person="baoengb" - type="translation" date="02.03.2004"/> - - <file name="reference/mysqli/functions/mysqli-options.xml" person="baoengb" - type="translation" date="02.03.2004"/> - - <file name="reference/mysqli/functions/mysqli-param-count.xml" person="baoengb" - type="translation" date="02.03.2004"/> - - <file name="reference/mysqli/functions/mysqli-ping.xml" person="baoengb" - type="translation" date="02.03.2004"/> - - <file name="reference/mysqli/functions/mysqli-prepare.xml" person="baoengb" - type="translation" date="02.03.2004"/> - <file name="reference/mysqli/functions/mysqli-query.xml" person="baoengb" type="translation" date="02.03.2004"/> http://cvs.php.net/co.php/phpdoc-es/reference/mysqli/functions/mysqli-next-result.xml?r=1.1&p=1 Index: phpdoc-es/reference/mysqli/functions/mysqli-next-result.xml +++ phpdoc-es/reference/mysqli/functions/mysqli-next-result.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.2 Maintainer: baoengb Status: ready --> <refentry id="function.mysqli-next-result"> <refnamediv> <refname>mysqli_next_result</refname> <refname>mysqli->next_result</refname> <refpurpose>Prepara el siguiente resultado de una consulta m&uacute;ltiple.</refpurpose> </refnamediv> <refsect1> <title>Descripci&oacute;n</title> <methodsynopsis> <type>bool</type><methodname>mysqli_next_result</methodname> <methodparam><type>objeto</type><parameter>identificador_de_enlace</parameter></methodparam> </methodsynopsis> <para> La funci&oacute;n <function>mysqli_next_result</function> prepara el siguiente resultado de una llamada previa a <function>mysqli_multi_query</function> el cu&aacute;l puede ser obtenido por <function>mysqli_store_result</function> o <function>mysqli_use_result</function>. </para> </refsect1> <refsect1> <title>Valores regresados</title> <para>&return.success;</para> </refsect1> <refsect1> <title>Vea tambi&eacute;n</title> <para> <function>mysqli_multi_query</function>, <function>mysqli_more_results</function>, <function>mysqli_store_result</function>, <function>mysqli_use_result</function> </para> </refsect1> <refsect1> <title>Ejemplo</title> <para> Vea <function>mysqli_multi_query</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 --> http://cvs.php.net/co.php/phpdoc-es/reference/mysqli/functions/mysqli-num-fields.xml?r=1.1&p=1 Index: phpdoc-es/reference/mysqli/functions/mysqli-num-fields.xml +++ phpdoc-es/reference/mysqli/functions/mysqli-num-fields.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.4 Maintainer: baoengb Status: ready --> <refentry id="function.mysqli-num-fields"> <refnamediv> <refname>mysqli_num_fields</refname> <refname>result->field_count</refname> <refpurpose> Obtiene el n&uacute;mero de campos en un resultado Get the number of fields in a result </refpurpose> </refnamediv> <refsect1> <title>Descripci&oacute;n</title> <para>Estilo por procedimientos:</para> <methodsynopsis> <type>int</type><methodname>mysqli_num_fields</methodname> <methodparam><type>objeto</type><parameter>resultado</parameter></methodparam> </methodsynopsis> <para>Estilo orientado a objetos (propiedad</para> <classsynopsis> <ooclass><classname>resultado</classname></ooclass> <fieldsynopsis><type>int</type><varname>field_count</varname></fieldsynopsis> </classsynopsis> <para> <function>mysqli_num_fields</function> regresa el n&uacute;mero de campos del resultado espec&iacute;ficado. </para> </refsect1> <refsect1> &reftitle.returnvalues; <para>El n&uacute;merp de campos en un resultado</para> </refsect1> <refsect1> &reftitle.seealso; <para> <function>mysqli_fetch_field</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(); } if ($result = $mysqli->query("SELECT * FROM City ORDER BY ID LIMIT 1")) { /* determine number of fields in result set */ $field_cnt = $result->field_count; printf("Result set has %d fields.\n", $field_cnt); /* close result set */ $result->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(); } if ($result = mysqli_query($link, "SELECT * FROM City ORDER BY ID LIMIT 1")) { /* determine number of fields in result set */ $field_cnt = mysqli_num_fields($result); printf("Result set has %d fields.\n", $field_cnt); /* close result set */ mysqli_free_result($result); } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> <para> Los ejemplos anteriores producir&aacute;n la siguiente salida: </para> <screen> <![CDATA[ Result set has 5 fields. ]]> </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-num-rows.xml?r=1.1&p=1 Index: phpdoc-es/reference/mysqli/functions/mysqli-num-rows.xml +++ phpdoc-es/reference/mysqli/functions/mysqli-num-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-num-rows"> <refnamediv> <refname>mysqli_num_rows</refname> <refpurpose> Obtiene el n&uacute;mero de filas en un resultado </refpurpose> </refnamediv> <refsect1> <title>Descripci&oacute;n</title> <para>Estilo por procedimientos:</para> <methodsynopsis> <type>mixto</type><methodname>mysqli_num_rows</methodname> <methodparam><type>objeto</type><parameter>resultado</parameter></methodparam> </methodsynopsis> <para>Estilo orientado a objetos (propiedad):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <fieldsynopsis><type>mixto</type><varname>num_rows</varname></fieldsynopsis> </classsynopsis> <para> Regresa el n&uacute;mero de filas en el resultado. </para> <para> El uso de <function>mysqli_num_rows</function> depende de si se usa resultados con almacenamiento intermedio (buffered) o no. En caso de usar resultados sin almacenamiento intermedio, <function>mysqli_num_rows</function> no dar&aacute; el n&uacute;mero correcto de filas hasta que se hayan obtenido todas las filas del resultado. </para> </refsect1> <refsect1> &reftitle.returnvalues; <para> Regresa el n&uacute;mero de filas en el resultado. </para> <note> <para> Si el n&uacute;mero de filas es superior al valor entero maximo, el n&uacute;mero ser&aacute; regresado como una cadena. </para> </note> </refsect1> <refsect1> &reftitle.seealso; <para> <function>mysqli_affected_rows</function> <function>mysqli_store_result</function> <function>mysqli_use_result</function> <function>mysqli_query</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(); } if ($result = $mysqli->query("SELECT Code, Name FROM Country ORDER BY Name")) { /* determine number of rows result set */ $row_cnt = $result->num_rows; printf("Result set has %d rows.\n", $row_cnt); /* close result set */ $result->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(); } if ($result = mysqli_query($link, "SELECT Code, Name FROM Country ORDER BY Name")) { /* determine number of rows result set */ $row_cnt = mysqli_num_rows($result); printf("Result set has %d rows.\n", $row_cnt); /* close result set */ mysqli_free_result($result); } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> <para> Los ejemplos anteriores producir&aacute;n la siguiente salida: </para> <screen> <![CDATA[ Result set has 239 rows. ]]> </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-options.xml?r=1.1&p=1 Index: phpdoc-es/reference/mysqli/functions/mysqli-options.xml +++ phpdoc-es/reference/mysqli/functions/mysqli-options.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.4 Maintainer: baoengb Status: ready --> <refentry id="function.mysqli-options"> <refnamediv> <refname>mysqli_options</refname> <refname>mysqli->options</refname> <refpurpose>Fija opciones</refpurpose> </refnamediv> <refsect1> <title>Descripci&oacute;n</title> <para>Estilo por procedimientos:</para> <methodsynopsis> <type>bool</type><methodname>mysqli_options</methodname> <methodparam><type>objeto</type><parameter>identificador_de_enlace</parameter></methodparam> <methodparam><type>int</type><parameter>opci&oacute;n</parameter></methodparam> <methodparam><type>mixto</type><parameter>valor</parameter></methodparam> </methodsynopsis> <para>Estilo orientado a objetos (m&eacute;todo)</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <methodsynopsis> <type>bool</type> <methodname>options</methodname> <methodparam><type>int</type><parameter>opci&oacute;n</parameter></methodparam> <methodparam><type>mixto</type><parameter>valor</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> <function>mysqli_options</function> puede ser usada para fijar opciones extra en la conexi&oacute;n y afectar el comportamiento para la conexi&oacute;n. </para> <para> Esta funci&oacute;n puede ser llamada m&uacute;ltiples veces para fijar diferentes opciones. </para> <para> <function>mysqli_options</function> debe ser llamada despu&eacute;s de <function>mysqli_init</function> y antes de <function>mysqli_real_connect</function>. </para> <para> El par&aacute;metro <parameter>opci&oacute;n</parameter> es la opci&oacute;n que se busca cambiar, el par&aacute;metro <parameter>valor</parameter> es el valor para la opci&oacute;n. El par&aacute;metro <parameter>opci&acute;on</parameter> puede ser una de las siguientes: <table> <title>Opciones validas</title> <tgroup cols='2'> <thead> <row> <entry>Nombre</entry> <entry>Descripci&oacute;n</entry> </row> </thead> <tbody> <row> <entry><constant>MYSQLI_OPT_CONNECT_TIMEOUT</constant></entry> <entry>Tiempo que espera para ser conectado en segundos</entry> </row> <row> <entry><constant>MYSQLI_OPT_COMPRESS</constant></entry> <entry>use protocolo de compresi&oacute;n</entry> </row> <row> <entry><constant>MYSQLI_OPT_LOCAL_INFILE</constant></entry> <entry>habilita/deshabilita el uso de <literal>LOAD LOCAL INFILE</literal></entry> </row> <row> <entry><constant>MYSQLI_INIT_CMD</constant></entry> <entry>comando a ejecutar despu&eacute;s cuando se conecte al servidor MySQL</entry> </row> <row> <entry><constant>MYSQLI_READ_DEFAULT_FILE</constant></entry> <entry> Lee las opciones del archivo de configuraci&oacute;n espec&iacute;ficado en vez de<filename>my.cnf</filename> </entry> </row> <row> <entry><constant>MYSQLI_READ_DEFAULT_GROUP</constant></entry> <entry> Lee las opciones del grupo del archivo<filename>my.cnf</filename> o del archivo espec&iacute;ficado con <constant>MYSQL_READ_DEFAULT_FILE</constant>. </entry> </row> </tbody> </tgroup> </table> </para> </refsect1> <refsect1> &reftitle.returnvalues; <para>&return.success;</para> </refsect1> <refsect1> &reftitle.seealso; <para> <function>mysqli_init</function>, <function>mysqli_real_connect</function> </para> </refsect1> <refsect1> <title>Ejemplo</title> <para>Vea <function>mysqli_real_connect</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 --> http://cvs.php.net/co.php/phpdoc-es/reference/mysqli/functions/mysqli-param-count.xml?r=1.1&p=1 Index: phpdoc-es/reference/mysqli/functions/mysqli-param-count.xml +++ phpdoc-es/reference/mysqli/functions/mysqli-param-count.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.7 Maintainer: baoengb Status: ready --> <refentry id="function.mysqli-param-count"> <refnamediv> <refname>mysqli_param_count</refname> <refpurpose>Alias para <function>mysqli_stmt_param_count</function></refpurpose> </refnamediv> <refsect1> <title>Descripci&oacute;n</title> <para> Esta funci&oacute;n es un alias de <function>mysqli_stmt_param_count</function>. Para una descipci&oacute;n detallada vea <function>mysqli_stmt_param_count</function>. </para> <note> <para> <function>mysqli_param_count</function> es obsoleta y ser&aacute; removida. </para> </note> </refsect1> <refsect1> <title>Vea tambi&eacute;n</title> <para> <function>mysqli_stmt_param_count</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 --> http://cvs.php.net/co.php/phpdoc-es/reference/mysqli/functions/mysqli-ping.xml?r=1.1&p=1 Index: phpdoc-es/reference/mysqli/functions/mysqli-ping.xml +++ phpdoc-es/reference/mysqli/functions/mysqli-ping.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.5 Maintainer: baoengb Status: ready --> <refentry id="function.mysqli-ping"> <refnamediv> <refname>mysqli_ping</refname> <refname>mysqli->ping</refname> <refpurpose> Revisa una conexi&oacute;n al servidor o intenta reconectar si la conexi&oacite;n se ha perdido. </refpurpose> </refnamediv> <refsect1> <title>Descripci&oacute;n</title> <para>Estilo por procedimientos:</para> <methodsynopsis> <type>bool</type><methodname>mysqli_ping</methodname> <methodparam><type>objeto</type><parameter>identificador_de_enlace</parameter></methodparam> </methodsynopsis> <para>Estilo orientado a objetos (m&eacute;todo):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <methodsynopsis> <type>bool</type><methodname>ping</methodname> <void/> </methodsynopsis> </classsynopsis> <para> Checa si la conexi&oacute;n al servidor est&aacute; operando. Si se perdi&acute; y la opci&oacute;n global <literal>mysqli.reconnect</literal> esta activa se intenta una reconexi&oacute;n autom&aacute;tica. </para> <para> Esta funci&oacute;n puede ser usada por clientes que duran mucho tiempo inactivos, para checar si el servidor ha verrado al conexi&oacute;n y reconectarse en caso necesario. </para> </refsect1> <refsect1> <title>Valores Regresados</title> <para>&return.success;</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(); } /* check if server is alive */ if ($mysqli->ping()) { printf ("Our connection is ok!\n"); } else { printf ("Error: %s\n", $mysqli->error); } /* 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(); } /* check if server is alive */ if (mysqli_ping($link)) { printf ("Our connection is ok!\n"); } else { printf ("Error: %s\n", mysqli_error($link)); } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> <para> Los ejemplos anteriores producir&aacute; la siguiente salida: </para> <screen> <![CDATA[ Our connection is ok! ]]> </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-prepare.xml?r=1.1&p=1 Index: phpdoc-es/reference/mysqli/functions/mysqli-prepare.xml +++ phpdoc-es/reference/mysqli/functions/mysqli-prepare.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.5 Maintainer: baoengb Status: ready --> <refentry id="function.mysqli-prepare"> <refnamediv> <refname>mysqli_prepare</refname> <refname>mysqli->prepare</refname> <refpurpose> Prepara una sentencia SQL para su ejecuci&oacute;n </refpurpose> </refnamediv> <refsect1> <title>Descripci&oacute;n</title> <para>Estilo por procedimientos:</para> <methodsynopsis> <type>mixto</type><methodname>mysqli_prepare</methodname> <methodparam><type>objeto</type><parameter>identificador_de_enlace</parameter></methodparam> <methodparam><type>cadena</type><parameter>query</parameter></methodparam> </methodsynopsis> <para>Estilo orientado a objetos (m&eacute;todo)</para> <classsynopsis> <ooclass><classname>stmt</classname></ooclass> <methodsynopsis> <type>mixto</type> <methodname>prepare</methodname> <methodparam><type>cadena</type><parameter>query</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> <function>mysqli_prepare</function> prepara la consulta SQL acentuada por la terminaci&oacute;n en caracter nulo, y regresa un manejador para ser usado para las operaciones en la sentencia. La consulta debe consistir de un solo enunciado SQL. </para> <note> <para> No debe agregar el punto y coma al fina o <literal>\g</literal> al enunciado. </para> </note> <para> El par&aacute;metro <parameter>query</parameter> puede incluir uno o m&aacute;s marcadores de par&aacute;metros en la sentencia SQL, incluyendo el caracter (<literal>?</literal>) en las posiciones apropiadas. </para> <note> <para> Los marcadores son legales solo en ciertos lugares de la sentencia SQL. Por ejemplo, son permitidos en la lista de VALUES() de una sentencia INSERT (para espec&iacute;ficar los valores de las columnas en la fila), o en una comparaci&oacute;n con una columna en una clausula WHERE para espec&iacite;ficar un valor de comparaci&oacute;n. </para> <para> Sin embargo, no son permitidos para identificadores (tales como nombres de tablas y columnas, en la selecci&oacute;n de los nombres de las columnas a ser regresadas por la sentencia SELECT), o para espec&iacite;ficar operadores binarios tales como <literal>=</literal> el signo de igual. La &uacute;ltima restricci&oacute;n es necesaria porque ser&iacute;a imposible determinar el tipo del par&aacute;metro. En general, los par&aacute;metros son legales solo en las sentencias del lenguaje de manipulaci&oacute;n de datos (DML), y no en las sentencias del lenguaje de definici&oacute;n de datos (DDL). </para> </note> <para> Los marcadores de par&aacute;metros deben estar ligados a variables de la aplicaci&oacute;n usando <function>mysqli_stmt_bind_param</function> y/o <function>mysqli_stmt_bind_result</function> antes de ejecutar la sentencia SQL u obtener las filas. </para> </refsect1> <refsect1> &reftitle.returnvalues; <para> <function>mysqli_prepare</function> regresa un objeto o &false; si ocurre un erro. </para> </refsect1> <refsect1> &reftitle.seealso; <para> <function>mysqli_stmt_execute</function>, <function>mysqli_stmt_fetch</function>, <function>mysqli_stmt_bind_param</function>, <function>mysqli_stmt_bind_result</function>, <function>mysqli_stmt_close</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(); } $city = "Amersfoort"; /* create a prepared statement */ if ($stmt = $mysqli->prepare("SELECT District FROM City WHERE Name=?")) { /* bind parameters for markers */ $stmt->bind_param("s", $city); /* execute query */ $stmt->execute(); /* bind result variables */ $stmt->bind_result($district); /* fetch value */ $stmt->fetch(); printf("%s is in district %s\n", $city, $district); /* 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(); } $city = "Amersfoort"; /* create a prepared statement */ if ($stmt = mysqli_prepare($link, "SELECT District FROM City WHERE Name=?")) { /* bind parameters for markers */ mysqli_stmt_bind_param($stmt, "s", $city); /* execute query */ mysqli_stmt_execute($stmt); /* bind result variables */ mysqli_stmt_bind_result($stmt, $district); /* fetch value */ mysqli_stmt_fetch($stmt); printf("%s is in district %s\n", $city, $district); /* close statement */ mysqli_stmt_close($stmt); } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> <para> Los ejemplos anteriores producir&aacute; la siguiente salida: </para> <screen> <![CDATA[ Amersfoort is in district Utrecht ]]> </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 -->
« previous php.doc.es (#574) next »