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: | Enrique Garcia Briones | 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últiple.</refpurpose> </refnamediv> <refsect1> <title>Descripció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ón <function>mysqli_next_result</function> prepara el siguiente resultado de una llamada previa a <function>mysqli_multi_query</function> el cuá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é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úmero de campos en un resultado Get the number of fields in a result </refpurpose> </refnamediv> <refsect1> <title>Descripció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úmero de campos del resultado específicado. </para> </refsect1> <refsect1> &reftitle.returnvalues; <para>El nú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á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úmero de filas en un resultado </refpurpose> </refnamediv> <refsect1> <title>Descripció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ú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á el número correcto de filas hasta que se hayan obtenido todas las filas del resultado. </para> </refsect1> <refsect1> &reftitle.returnvalues; <para> Regresa el número de filas en el resultado. </para> <note> <para> Si el número de filas es superior al valor entero maximo, el número será 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á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ó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ón</parameter></methodparam> <methodparam><type>mixto</type><parameter>valor</parameter></methodparam> </methodsynopsis> <para>Estilo orientado a objetos (método)</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <methodsynopsis> <type>bool</type> <methodname>options</methodname> <methodparam><type>int</type><parameter>opció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ón y afectar el comportamiento para la conexión. </para> <para> Esta función puede ser llamada múltiples veces para fijar diferentes opciones. </para> <para> <function>mysqli_options</function> debe ser llamada después de <function>mysqli_init</function> y antes de <function>mysqli_real_connect</function>. </para> <para> El parámetro <parameter>opción</parameter> es la opción que se busca cambiar, el parámetro <parameter>valor</parameter> es el valor para la opción. El parámetro <parameter>opci´on</parameter> puede ser una de las siguientes: <table> <title>Opciones validas</title> <tgroup cols='2'> <thead> <row> <entry>Nombre</entry> <entry>Descripció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ó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é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ón especí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í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ón</title> <para> Esta función es un alias de <function>mysqli_stmt_param_count</function>. Para una descipción detallada vea <function>mysqli_stmt_param_count</function>. </para> <note> <para> <function>mysqli_param_count</function> es obsoleta y será removida. </para> </note> </refsect1> <refsect1> <title>Vea tambié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ón al servidor o intenta reconectar si la conexi&oacite;n se ha perdido. </refpurpose> </refnamediv> <refsect1> <title>Descripció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étodo):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <methodsynopsis> <type>bool</type><methodname>ping</methodname> <void/> </methodsynopsis> </classsynopsis> <para> Checa si la conexión al servidor está operando. Si se perdi´ y la opción global <literal>mysqli.reconnect</literal> esta activa se intenta una reconexión automática. </para> <para> Esta función puede ser usada por clientes que duran mucho tiempo inactivos, para checar si el servidor ha verrado al conexió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á 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ón </refpurpose> </refnamediv> <refsect1> <title>Descripció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é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ó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ámetro <parameter>query</parameter> puede incluir uno o más marcadores de pará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íficar los valores de las columnas en la fila), o en una comparación con una columna en una clausula WHERE para espec&iacite;ficar un valor de comparación. </para> <para> Sin embargo, no son permitidos para identificadores (tales como nombres de tablas y columnas, en la selecció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 última restricción es necesaria porque sería imposible determinar el tipo del parámetro. En general, los parámetros son legales solo en las sentencias del lenguaje de manipulación de datos (DML), y no en las sentencias del lenguaje de definición de datos (DDL). </para> </note> <para> Los marcadores de parámetros deben estar ligados a variables de la aplicació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á 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 -->
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últiple.</refpurpose> </refnamediv> <refsect1> <title>Descripció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ón <function>mysqli_next_result</function> prepara el siguiente resultado de una llamada previa a <function>mysqli_multi_query</function> el cuá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é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úmero de campos en un resultado Get the number of fields in a result </refpurpose> </refnamediv> <refsect1> <title>Descripció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úmero de campos del resultado específicado. </para> </refsect1> <refsect1> &reftitle.returnvalues; <para>El nú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á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úmero de filas en un resultado </refpurpose> </refnamediv> <refsect1> <title>Descripció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ú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á el número correcto de filas hasta que se hayan obtenido todas las filas del resultado. </para> </refsect1> <refsect1> &reftitle.returnvalues; <para> Regresa el número de filas en el resultado. </para> <note> <para> Si el número de filas es superior al valor entero maximo, el número será 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á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ó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ón</parameter></methodparam> <methodparam><type>mixto</type><parameter>valor</parameter></methodparam> </methodsynopsis> <para>Estilo orientado a objetos (método)</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <methodsynopsis> <type>bool</type> <methodname>options</methodname> <methodparam><type>int</type><parameter>opció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ón y afectar el comportamiento para la conexión. </para> <para> Esta función puede ser llamada múltiples veces para fijar diferentes opciones. </para> <para> <function>mysqli_options</function> debe ser llamada después de <function>mysqli_init</function> y antes de <function>mysqli_real_connect</function>. </para> <para> El parámetro <parameter>opción</parameter> es la opción que se busca cambiar, el parámetro <parameter>valor</parameter> es el valor para la opción. El parámetro <parameter>opci´on</parameter> puede ser una de las siguientes: <table> <title>Opciones validas</title> <tgroup cols='2'> <thead> <row> <entry>Nombre</entry> <entry>Descripció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ó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é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ón especí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í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ón</title> <para> Esta función es un alias de <function>mysqli_stmt_param_count</function>. Para una descipción detallada vea <function>mysqli_stmt_param_count</function>. </para> <note> <para> <function>mysqli_param_count</function> es obsoleta y será removida. </para> </note> </refsect1> <refsect1> <title>Vea tambié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ón al servidor o intenta reconectar si la conexi&oacite;n se ha perdido. </refpurpose> </refnamediv> <refsect1> <title>Descripció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étodo):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <methodsynopsis> <type>bool</type><methodname>ping</methodname> <void/> </methodsynopsis> </classsynopsis> <para> Checa si la conexión al servidor está operando. Si se perdi´ y la opción global <literal>mysqli.reconnect</literal> esta activa se intenta una reconexión automática. </para> <para> Esta función puede ser usada por clientes que duran mucho tiempo inactivos, para checar si el servidor ha verrado al conexió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á 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ón </refpurpose> </refnamediv> <refsect1> <title>Descripció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é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ó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ámetro <parameter>query</parameter> puede incluir uno o más marcadores de pará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íficar los valores de las columnas en la fila), o en una comparación con una columna en una clausula WHERE para espec&iacite;ficar un valor de comparación. </para> <para> Sin embargo, no son permitidos para identificadores (tales como nombres de tablas y columnas, en la selecció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 última restricción es necesaria porque sería imposible determinar el tipo del parámetro. En general, los parámetros son legales solo en las sentencias del lenguaje de manipulación de datos (DML), y no en las sentencias del lenguaje de definición de datos (DDL). </para> </note> <para> Los marcadores de parámetros deben estar ligados a variables de la aplicació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á 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 -->