cvs: phpdoc-es /reference/mysqli/functions mysqli-sqlstate.xml mysqli-ssl-set.xml mysqli-stat.xml mysqli-store-result.xml mysqli-thread-id.xml
mysqli-thread-safe.xml mysqli-use-result.xml mysqli-warning-count.xml
| From: | Enrique Garcia Briones | Date: | Wed, 12 May 2004 18:00:48 +0000 |
| Subject: | cvs: phpdoc-es /reference/mysqli/functions mysqli-sqlstate.xml mysqli-ssl-set.xml mysqli-stat.xml mysqli-store-result.xml mysqli-thread-id.xml mysqli-thread-safe.xml mysqli-use-result.xml mysqli-warning-count.xml |
||
| Groups: | php.doc.es | ||
| Request: | Send a blank email to doc-es+get-588@lists.php.net to get a copy of this message | ||
baoengb Wed May 12 14:00:48 2004 EDT
Added files:
/phpdoc-es/reference/mysqli/functions mysqli-sqlstate.xml
mysqli-ssl-set.xml
mysqli-stat.xml
mysqli-store-result.xml
mysqli-thread-id.xml
mysqli-thread-safe.xml
mysqli-use-result.xml
mysqli-warning-count.xml
Log:
ahora si
http://cvs.php.net/co.php/phpdoc-es/reference/mysqli/functions/mysqli-sqlstate.xml?r=1.1&p=1 Index: phpdoc-es/reference/mysqli/functions/mysqli-sqlstate.xml +++ phpdoc-es/reference/mysqli/functions/mysqli-sqlstate.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.3 Maintainer: baoengb Status: ready --> <refentry id="function.mysqli-sqlstate"> <refnamediv> <refname>mysqli_sqlstate</refname> <refname>mysqli->sqlstate</refname> <refpurpose>Regresa el error SQLSTATE de la operación MySQL previa.</refpurpose> </refnamediv> <refsect1> <title>Descripción</title> <para>Estilo por procedimientos:</para> <methodsynopsis> <type>cadena</type><methodname>mysqli_sqlstate</methodname> <methodparam><type>objeto</type><parameter>identificador_de_enlace</parameter></methodparam> </methodsynopsis> <para>Estilo orientado a objetos (propiedad):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <fieldsynopsis><type>int</type><varname>sqlstate</varname></fieldsynopsis> </classsynopsis> <para> Regresa una cadena conteniendo el código de error SQLSTATE para el último error. El código de error consiste en cinco caracteres. <literal>'00000'</literal> significa que no hay error. Los valores están espec&iacite;ficados por el SQL ANSI y ODBC. Para una lista de los valores posibles, vea <ulink url="&url.mysql.docs.error;">&url.mysql.docs.error;</ulink>. </para> <note> <para> Noete que no todos los errores de MySQL han sido mapeados a los de SQLSTATE. El valor <literal>HY000</literal> (error general) es usado para errores no mapeados. </para> </note> </refsect1> <refsect1> <title>Valores regresados</title> <para> Regresa una cadena conteniendo el código de error SQLSTAT para el último error. El código de error consiste en cinco caracteres. <literal>'00000'</literal> significa que no hubo error. </para> </refsect1> <refsect1> <title>Vea también</title> <para> <function>mysqli_errno</function>, <function>mysqli_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(); } /* Table City already exists, so we should get an error */ if (!$mysqli->query("CREATE TABLE City (ID INT, Name VARCHAR(30))")) { printf("Error - SQLSTATE %s.\n", $mysqli->sqlstate); } $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(); } /* Table City already exists, so we should get an error */ if (!mysqli_query($link, "CREATE TABLE City (ID INT, Name VARCHAR(30))")) { printf("Error - SQLSTATE %s.\n", mysqli_sqlstate($link)); } mysqli_close($link); ?> ]]> </programlisting> </example> <para> Los ejemplos anteriores producirán la siguiente salida: </para> <screen> <![CDATA[ Error - SQLSTATE 42S01. ]]> </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-ssl-set.xml?r=1.1&p=1 Index: phpdoc-es/reference/mysqli/functions/mysqli-ssl-set.xml +++ phpdoc-es/reference/mysqli/functions/mysqli-ssl-set.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.3 Maintainer: baoengb Status: ready --> <refentry id="function.mysqli-ssl-set"> <refnamediv> <refname>mysqli_ssl_set</refname> <refname>mysqli->ssl_set</refname> <refpurpose>Usado para establecer conexiones seguras usando SSL.</refpurpose> </refnamediv> <refsect1> <title>Descripción</title> <para>Estilo por procedimientos:</para> <methodsynopsis> <type>bool</type><methodname>mysqli_ssl_set</methodname> <methodparam><type>objeto</type><parameter>identificador_de_enlace</parameter></methodparam> <methodparam choice='opt'><type>cadena</type><parameter>key</parameter></methodparam> <methodparam choice='opt'><type>cadena</type><parameter>cert</parameter></methodparam> <methodparam choice='opt'><type>cadena</type><parameter>ca</parameter></methodparam> <methodparam choice='opt'><type>cadena</type><parameter>capath</parameter></methodparam> <methodparam choice='opt'><type>cadena</type><parameter>cipher</parameter></methodparam> </methodsynopsis> <para>Estilo orientado a objetos (método):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <methodsynopsis> <type>bool</type><methodname>ssl_set</methodname> <methodparam choice='opt'><type>cadena</type><parameter>key</parameter></methodparam> <methodparam choice='opt'><type>cadena</type><parameter>cert</parameter></methodparam> <methodparam choice='opt'><type>cadena</type><parameter>ca</parameter></methodparam> <methodparam choice='opt'><type>cadena</type><parameter>capath</parameter></methodparam> <methodparam choice='opt'><type>cadena</type><parameter>cipher</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> La función <function>mysqli_ssl_set</function> es usada para establecer conexiones seguras usando SSL. Esta debe ser llamada antes de <function>mysqli_real_connect</function>. Esta función no hace nada a menos que el soporte OpenSSL este activo. </para> <para> <parameter>key</parameter> es la ubicación del archivo principal. <parameter>cert</parameter> es la ubicación del archivo del certificado. <parameter>ca</parameter> es la ubicación del archivo de autorización del certificado. <parameter>capath</parameter> es la ubicación del directorio que contiene los certificados SSL CA en que se confí en formato pem. <parameter>cipher</parameter> es una lista de los ciphes permitidos a usar para la encriptación SSL. Cualquier parámetro SSL sin usar, recibirá el valor &null; </para> </refsect1> <refsect1> <title>Valores regresados</title> <para> Está función siempre regresa el valor &true;. Si la disposición de SSL está incorrecta <function>mysqli_real_connect</function> regresará un error cuando se intente conectar. </para> </refsect1> <refsect1> <title>Vea tambié</title> <para> <function>mysqli_options</function>, <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-stat.xml?r=1.1&p=1 Index: phpdoc-es/reference/mysqli/functions/mysqli-stat.xml +++ phpdoc-es/reference/mysqli/functions/mysqli-stat.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.5 Maintainer: baoengb Status: ready --> <refentry id="function.mysqli-stat"> <refnamediv> <refname>mysqli_stat</refname> <refname>mysqli->stat</refname> <refpurpose>Obtiene el estado actual del sistema</refpurpose> </refnamediv> <refsect1> <title>Descripción</title> <para>Estilo por procedimientos:</para> <methodsynopsis> <type>mixto</type><methodname>mysqli_stat</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>mixto</type><methodname>mysqli->stat</methodname> <void /> </methodsynopsis> </classsynopsis> <para> <function>mysqli_stat</function> regresa una cadena conteniendo información similar a la proveida por el comando 'mysqladmin status'. Esto incluye el tiempo total activo del servidor en segundos y en número de procesos ejecutandose, preguntas, recargas y tablas abiertas. </para> </refsect1> <refsect1> <title>Valores regresados</title> <para> Una cadena describiendo el estado del servidor. &false; si un error ocurre. </para> </refsect1> <refsect1> <title>Vea también</title> <para> <function>mysqli_get_server_info</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(); } printf ("System status: %s\n", $mysqli->stat()); $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(); } printf("System status: %s\n", mysqli_stat($link)); mysqli_close($link); ?> ]]> </programlisting> </example> <para> Los ejemplos anteriores producirán la siguiente salida: </para> <screen> <![CDATA[ System status: Uptime: 272 Threads: 1 Questions: 5340 Slow queries: 0 Opens: 13 Flush tables: 1 Open tables: 0 Queries per second avg: 19.632 Memory in use: 8496K Max memory used: 8560K ]]> </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-store-result.xml?r=1.1&p=1 Index: phpdoc-es/reference/mysqli/functions/mysqli-store-result.xml +++ phpdoc-es/reference/mysqli/functions/mysqli-store-result.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.mysqli-store-result"> <refnamediv> <refname>mysqli_store_result</refname> <refname>mysqli->store_result</refname> <refpurpose>Transfers a result set from the last query</refpurpose> </refnamediv> <refsect1> <title>Description</title> <para>Procedural style:</para> <methodsynopsis> <type>object</type><methodname>mysqli_store_result</methodname> <methodparam><type>object</type><parameter>link</parameter></methodparam> </methodsynopsis> <para>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <methodsynopsis> <type>object</type> <methodname>store_result</methodname> <void /> </methodsynopsis> </classsynopsis> <para> Transfers the result set from the last query on the database connection represented by the <parameter>link</parameter> parameter to be used with the <function>mysqli_data_seek</function> function. </para> <note> <para> Although it is always good practice to free the memory used by the result of a query using the <function>mysqli_free_result</function> function, when transfering large result sets using the <function>mysqli_store_result</function> this becomes particularly important. </para> </note> <note> <para> <function>mysqli_store_result</function> returns &false; in case the query didn't return a result set (if the query was, for example an INSERT statement). This function also returns &false; if the reading of the result set failed. You can check if you have got an error by checking if <function>mysqli_error</function> doesn't return an empty string, if <function>mysqli_errno</function> returns a non zero value, or if <function>mysqli_field_count</function> returns a non zero value. Also possible reason for this function returning &false; after successfull call to <function>mysqli_query</function> can be too large result set (memory for it cannot be allocated). If <function>mysqli_field_count</function> returns a non-zero value, the statement should have produced a non-empty result set. </para> </note> </refsect1> <refsect1> <title>Return values</title> <para> Returns a buffered result object or &false; if an error occured. </para> </refsect1> <refsect1> <title>See also</title> <para> <function>mysqli_real_query</function>, <function>mysqli_use_result</function>. </para> </refsect1> <refsect1> <title>Example</title> <para> See <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-thread-id.xml?r=1.1&p=1 Index: phpdoc-es/reference/mysqli/functions/mysqli-thread-id.xml +++ phpdoc-es/reference/mysqli/functions/mysqli-thread-id.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.6 Maintainer: baoengb Status: ready --> <refentry id="function.mysqli-thread-id"> <refnamediv> <refname>mysqli_thread_id</refname> <refname>mysqli->thread_id</refname> <refpurpose>Regresa el identificador del THREAD para la conexión actual</refpurpose> </refnamediv> <refsect1> <title>Descripción</title> <para>Estilo por procedimientos:</para> <methodsynopsis> <type>int</type><methodname>mysqli_thread_id</methodname> <methodparam><type>objeto</type><parameter>identificador_de_enlace</parameter></methodparam> </methodsynopsis> <para>Estilo orientado a objetos (propiedad):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <fieldsynopsis><type>int</type><varname>thread_id</varname></fieldsynopsis> </classsynopsis> <para> La finción <function>mysqli_thread_id</function> regresa el identificador del THREAD para la conexión actual la cual puede ser entonces destruir usando la función <function>mysqli_kill</function>. Si la conexión se pierde y se reconecta con <function>mysqli_ping</function>, el identificador del THREAD será otro. Por lo tanto debe obtener el identificador del THREAD solo cuando lo necesite. </para> <note> <para> El identificador del THREAD es asignado en base a conexión. Por lo tanto si la conexión está rota y entonces se reestablece se le asignará un nuevo identificador de THREAD. </para> <para> Para destruir una consulta que se está ejecutando use el comando SQL <literal>KILL QUERY processid</literal>. </para> </note> </refsect1> <refsect1> <title>Valores regresados</title> <para> <function>mysqli_thread_id</function> regresa el identificador del THREAD para la conexión actual. </para> </refsect1> <refsect1> <title>Vea también</title> <para> <function>mysqli_kill</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(); } /* determine our thread id */ $thread_id = $mysqli->thread_id; /* Kill connection */ $mysqli->kill($thread_id); /* This should produce an error */ if (!$mysqli->query("CREATE TABLE myCity LIKE City")) { printf("Error: %s\n", $mysqli->error); exit; } /* 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(); } /* determine our thread id */ $thread_id = mysqli_thread_id($link); /* Kill connection */ mysqli_kill($link, $thread_id); /* This should produce an error */ if (!mysqli_query($link, "CREATE TABLE myCity LIKE City")) { printf("Error: %s\n", mysqli_error($link)); exit; } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> <para> Los ejemplos anteriores producirán la siguiente salida: </para> <screen> <![CDATA[ Error: MySQL server has gone away ]]> </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-thread-safe.xml?r=1.1&p=1 Index: phpdoc-es/reference/mysqli/functions/mysqli-thread-safe.xml +++ phpdoc-es/reference/mysqli/functions/mysqli-thread-safe.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.4 Maintainer: baoengb Status: ready --> <refentry id="function.mysqli-thread-safe"> <refnamediv> <refname>mysqli_thread_safe</refname> <refpurpose>Regresa si se ha dado un THREAD seguro o no Returns whether thread safety is given or not</refpurpose> </refnamediv> <refsect1> <title>Descripción</title> <para>Estilo por procedimientos:</para> <methodsynopsis> <type>bool</type><methodname>mysqli_thread_safe</methodname> <void /> </methodsynopsis> <para> <function>mysqli_thread_safe</function> indica si la libreria del cliente ha sido compilada como thread seguro. </para> </refsect1> <refsect1> <title>Valores regresados</title> <para> &true; si la libreria del client es thread seguro, en otro caso &false;. </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-use-result.xml?r=1.1&p=1 Index: phpdoc-es/reference/mysqli/functions/mysqli-use-result.xml +++ phpdoc-es/reference/mysqli/functions/mysqli-use-result.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.8 Maintainer: baoengb Status: ready --> <refentry id="function.mysqli-use-result"> <refnamediv> <refname>mysqli_use_result</refname> <refname>mysqli->use_result</refname> <refpurpose>Inicia una recuperación de un resultado</refpurpose> </refnamediv> <refsect1> <title>Descripción</title> <para>Estilo por procedimientos:</para> <methodsynopsis> <type>mixto</type><methodname>mysqli_use_result</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>mixto</type> <methodname>use_result</methodname> <void /> </methodsynopsis> </classsynopsis> <para> <function>mysqli_use_result</function> es usada para iniciar la recuperación de un resultado de la última consulta ejecutada usando la función <function>mysqli_real_query</function> en la conexión de base de datos específicda por el parámetro <parameter>identificador_de_enlace</parameter>. Esta o la funció <function>mysqli_store_result</function> debe ser llamada antes de que el resultado de una consulta pueda ser recuperado, y una o la otra debe esr llamada para prevenir que falle la siguiente consulta en la conexión a la base de datos. </para> <note> <para> La función <function>mysqli_use_result</function> no transfiere el resultado completo de la base de datos y por lo tanto no puede ser usadas funciones tales como <function>mysqli_data_seek</function> para moverse a una fila indicada en el resultado. Para usar esta funcionalidad, el resultado debe ser almacenado usando <function>mysqli_store_result</function>. No se debe usar <function>mysqli_use_result</function> si se está haciendo demasiado procesamiento en el lado del cliente, puesto que esto sobrecargará el servidor y evitará que otros procesos puedan actualizar cualquier tabla de entre las cuales los datos están siendo obtenidos. </para> </note> </refsect1> <refsect1> <title>Valores regresados</title> <para> Regresa el objeto resultante sin almacenamiento intermedio o &false; si ha ocurrido un error. </para> </refsect1> <refsect1> <title>Vea también</title> <para> <function>mysqli_real_query</function>, <function>mysqli_store_result</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(); } $query = "SELECT CURRENT_USER();"; $query .= "SELECT Name FROM City ORDER BY ID LIMIT 20, 5"; /* execute multi query */ if ($mysqli->multi_query($query)) { do { /* store first result set */ if ($result = $mysqli->use_result()) { while ($row = $result->fetch_row()) { printf("%s\n", $row[0]); } $result->close(); } /* print divider */ if ($mysqli->more_results()) { printf("-----------------\n"); } } while ($mysqli->next_result()); } /* 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(); } $query = "SELECT CURRENT_USER();"; $query .= "SELECT Name FROM City ORDER BY ID LIMIT 20, 5"; /* execute multi query */ if (mysqli_multi_query($link, $query)) { do { /* store first result set */ if ($result = mysqli_use_result($link)) { while ($row = mysqli_fetch_row($result)) { printf("%s\n", $row[0]); } mysqli_free_result($result); } /* print divider */ if (mysqli_more_results($link)) { printf("-----------------\n"); } } while (mysqli_next_result($link)); } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> <para> Los ejemplos anteriores producián la siguiente salida: </para> <screen> <![CDATA[ my_user@localhost ----------------- Amersfoort Maastricht Dordrecht Leiden Haarlemmermeer ]]> </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 --> <!-- 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-warning-count.xml?r=1.1&p=1 Index: phpdoc-es/reference/mysqli/functions/mysqli-warning-count.xml +++ phpdoc-es/reference/mysqli/functions/mysqli-warning-count.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.5 Maintainer: baoengb Status: ready --> <refentry id="function.mysqli-warning-count"> <refnamediv> <refname>mysqli_warning_count</refname> <refname>mysqli->warning_count</refname> <refpurpose>Regresa el número de alertas de la última consulta para el identificador de enlace dado</refpurpose> </refnamediv> <refsect1> <title>Descripción</title> <para>Estilo por procedimientos:</para> <methodsynopsis> <type>int</type><methodname>mysqli_warning_count</methodname> <methodparam><type>objeto</type><parameter>identificador_de_enlace</parameter></methodparam> </methodsynopsis> <para>Estilo orientado a objetos (propiedad):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <fieldsynopsis><type>int</type><varname>warning_count</varname></fieldsynopsis> </classsynopsis> <para> <function>mysqli_warning_count</function> regresa el número de alertas de la última consulta en la conexión representada por el parámetro <parameter>identificador_de_enlace</parameter>. </para> <note> <para> Para recuperar los mensajes de alerta, puede usar el comando SQL <literal>SHOW WARNINGS [limit row_count]</literal>. </para> </note> </refsect1> <refsect1> <title>Valores regresados</title> <para> El Número de alertas o cero si no hay alertas. </para> </refsect1> <refsect1> <title>Vea también</title> <para> <function>mysqli_errno</function>, <function>mysqli_error</function>, <function>mysqli_sqlstate</function> </para> </refsect1> <refsect1> <title>Ejemplo</title> <example> <title>Estilo orientado a objetos</title> <programlisting role="php"> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $mysqli->query("CREATE TABLE myCity LIKE City"); /* a remarkable city in Wales */ $query = "INSERT INTO myCity (CountryCode, Name) VALUES('GBR', 'Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch')"; $mysqli->query($query); if ($mysqli->warning_count) { if ($result = $mysqli->query("SHOW WARNINGS")) { $row = $result->fetch_row(); printf("%s (%d): %s\n", $row[0], $row[1], $row[2]); $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(); } mysqli_query($link, "CREATE TABLE myCity LIKE City"); /* a remarkable long city name in Wales */ $query = "INSERT INTO myCity (CountryCode, Name) VALUES('GBR', 'Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch')"; mysqli_query($link, $query); if (mysqli_warning_count($link)) { if ($result = mysqli_query($link, "SHOW WARNINGS")) { $row = mysqli_fetch_row($result); printf("%s (%d): %s\n", $row[0], $row[1], $row[2]); mysqli_free_result($result); } } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> <para> Los ejemplos anteriores producián la siguiente salida: </para> <screen> <![CDATA[ Warning (1264): Data truncated for column 'Name' at row 1 ]]> </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-sqlstate.xml?r=1.1&p=1 Index: phpdoc-es/reference/mysqli/functions/mysqli-sqlstate.xml +++ phpdoc-es/reference/mysqli/functions/mysqli-sqlstate.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.3 Maintainer: baoengb Status: ready --> <refentry id="function.mysqli-sqlstate"> <refnamediv> <refname>mysqli_sqlstate</refname> <refname>mysqli->sqlstate</refname> <refpurpose>Regresa el error SQLSTATE de la operación MySQL previa.</refpurpose> </refnamediv> <refsect1> <title>Descripción</title> <para>Estilo por procedimientos:</para> <methodsynopsis> <type>cadena</type><methodname>mysqli_sqlstate</methodname> <methodparam><type>objeto</type><parameter>identificador_de_enlace</parameter></methodparam> </methodsynopsis> <para>Estilo orientado a objetos (propiedad):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <fieldsynopsis><type>int</type><varname>sqlstate</varname></fieldsynopsis> </classsynopsis> <para> Regresa una cadena conteniendo el código de error SQLSTATE para el último error. El código de error consiste en cinco caracteres. <literal>'00000'</literal> significa que no hay error. Los valores están espec&iacite;ficados por el SQL ANSI y ODBC. Para una lista de los valores posibles, vea <ulink url="&url.mysql.docs.error;">&url.mysql.docs.error;</ulink>. </para> <note> <para> Noete que no todos los errores de MySQL han sido mapeados a los de SQLSTATE. El valor <literal>HY000</literal> (error general) es usado para errores no mapeados. </para> </note> </refsect1> <refsect1> <title>Valores regresados</title> <para> Regresa una cadena conteniendo el código de error SQLSTAT para el último error. El código de error consiste en cinco caracteres. <literal>'00000'</literal> significa que no hubo error. </para> </refsect1> <refsect1> <title>Vea también</title> <para> <function>mysqli_errno</function>, <function>mysqli_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(); } /* Table City already exists, so we should get an error */ if (!$mysqli->query("CREATE TABLE City (ID INT, Name VARCHAR(30))")) { printf("Error - SQLSTATE %s.\n", $mysqli->sqlstate); } $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(); } /* Table City already exists, so we should get an error */ if (!mysqli_query($link, "CREATE TABLE City (ID INT, Name VARCHAR(30))")) { printf("Error - SQLSTATE %s.\n", mysqli_sqlstate($link)); } mysqli_close($link); ?> ]]> </programlisting> </example> <para> Los ejemplos anteriores producirán la siguiente salida: </para> <screen> <![CDATA[ Error - SQLSTATE 42S01. ]]> </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-ssl-set.xml?r=1.1&p=1 Index: phpdoc-es/reference/mysqli/functions/mysqli-ssl-set.xml +++ phpdoc-es/reference/mysqli/functions/mysqli-ssl-set.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.3 Maintainer: baoengb Status: ready --> <refentry id="function.mysqli-ssl-set"> <refnamediv> <refname>mysqli_ssl_set</refname> <refname>mysqli->ssl_set</refname> <refpurpose>Usado para establecer conexiones seguras usando SSL.</refpurpose> </refnamediv> <refsect1> <title>Descripción</title> <para>Estilo por procedimientos:</para> <methodsynopsis> <type>bool</type><methodname>mysqli_ssl_set</methodname> <methodparam><type>objeto</type><parameter>identificador_de_enlace</parameter></methodparam> <methodparam choice='opt'><type>cadena</type><parameter>key</parameter></methodparam> <methodparam choice='opt'><type>cadena</type><parameter>cert</parameter></methodparam> <methodparam choice='opt'><type>cadena</type><parameter>ca</parameter></methodparam> <methodparam choice='opt'><type>cadena</type><parameter>capath</parameter></methodparam> <methodparam choice='opt'><type>cadena</type><parameter>cipher</parameter></methodparam> </methodsynopsis> <para>Estilo orientado a objetos (método):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <methodsynopsis> <type>bool</type><methodname>ssl_set</methodname> <methodparam choice='opt'><type>cadena</type><parameter>key</parameter></methodparam> <methodparam choice='opt'><type>cadena</type><parameter>cert</parameter></methodparam> <methodparam choice='opt'><type>cadena</type><parameter>ca</parameter></methodparam> <methodparam choice='opt'><type>cadena</type><parameter>capath</parameter></methodparam> <methodparam choice='opt'><type>cadena</type><parameter>cipher</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> La función <function>mysqli_ssl_set</function> es usada para establecer conexiones seguras usando SSL. Esta debe ser llamada antes de <function>mysqli_real_connect</function>. Esta función no hace nada a menos que el soporte OpenSSL este activo. </para> <para> <parameter>key</parameter> es la ubicación del archivo principal. <parameter>cert</parameter> es la ubicación del archivo del certificado. <parameter>ca</parameter> es la ubicación del archivo de autorización del certificado. <parameter>capath</parameter> es la ubicación del directorio que contiene los certificados SSL CA en que se confí en formato pem. <parameter>cipher</parameter> es una lista de los ciphes permitidos a usar para la encriptación SSL. Cualquier parámetro SSL sin usar, recibirá el valor &null; </para> </refsect1> <refsect1> <title>Valores regresados</title> <para> Está función siempre regresa el valor &true;. Si la disposición de SSL está incorrecta <function>mysqli_real_connect</function> regresará un error cuando se intente conectar. </para> </refsect1> <refsect1> <title>Vea tambié</title> <para> <function>mysqli_options</function>, <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-stat.xml?r=1.1&p=1 Index: phpdoc-es/reference/mysqli/functions/mysqli-stat.xml +++ phpdoc-es/reference/mysqli/functions/mysqli-stat.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.5 Maintainer: baoengb Status: ready --> <refentry id="function.mysqli-stat"> <refnamediv> <refname>mysqli_stat</refname> <refname>mysqli->stat</refname> <refpurpose>Obtiene el estado actual del sistema</refpurpose> </refnamediv> <refsect1> <title>Descripción</title> <para>Estilo por procedimientos:</para> <methodsynopsis> <type>mixto</type><methodname>mysqli_stat</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>mixto</type><methodname>mysqli->stat</methodname> <void /> </methodsynopsis> </classsynopsis> <para> <function>mysqli_stat</function> regresa una cadena conteniendo información similar a la proveida por el comando 'mysqladmin status'. Esto incluye el tiempo total activo del servidor en segundos y en número de procesos ejecutandose, preguntas, recargas y tablas abiertas. </para> </refsect1> <refsect1> <title>Valores regresados</title> <para> Una cadena describiendo el estado del servidor. &false; si un error ocurre. </para> </refsect1> <refsect1> <title>Vea también</title> <para> <function>mysqli_get_server_info</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(); } printf ("System status: %s\n", $mysqli->stat()); $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(); } printf("System status: %s\n", mysqli_stat($link)); mysqli_close($link); ?> ]]> </programlisting> </example> <para> Los ejemplos anteriores producirán la siguiente salida: </para> <screen> <![CDATA[ System status: Uptime: 272 Threads: 1 Questions: 5340 Slow queries: 0 Opens: 13 Flush tables: 1 Open tables: 0 Queries per second avg: 19.632 Memory in use: 8496K Max memory used: 8560K ]]> </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-store-result.xml?r=1.1&p=1 Index: phpdoc-es/reference/mysqli/functions/mysqli-store-result.xml +++ phpdoc-es/reference/mysqli/functions/mysqli-store-result.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.mysqli-store-result"> <refnamediv> <refname>mysqli_store_result</refname> <refname>mysqli->store_result</refname> <refpurpose>Transfers a result set from the last query</refpurpose> </refnamediv> <refsect1> <title>Description</title> <para>Procedural style:</para> <methodsynopsis> <type>object</type><methodname>mysqli_store_result</methodname> <methodparam><type>object</type><parameter>link</parameter></methodparam> </methodsynopsis> <para>Object oriented style (method):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <methodsynopsis> <type>object</type> <methodname>store_result</methodname> <void /> </methodsynopsis> </classsynopsis> <para> Transfers the result set from the last query on the database connection represented by the <parameter>link</parameter> parameter to be used with the <function>mysqli_data_seek</function> function. </para> <note> <para> Although it is always good practice to free the memory used by the result of a query using the <function>mysqli_free_result</function> function, when transfering large result sets using the <function>mysqli_store_result</function> this becomes particularly important. </para> </note> <note> <para> <function>mysqli_store_result</function> returns &false; in case the query didn't return a result set (if the query was, for example an INSERT statement). This function also returns &false; if the reading of the result set failed. You can check if you have got an error by checking if <function>mysqli_error</function> doesn't return an empty string, if <function>mysqli_errno</function> returns a non zero value, or if <function>mysqli_field_count</function> returns a non zero value. Also possible reason for this function returning &false; after successfull call to <function>mysqli_query</function> can be too large result set (memory for it cannot be allocated). If <function>mysqli_field_count</function> returns a non-zero value, the statement should have produced a non-empty result set. </para> </note> </refsect1> <refsect1> <title>Return values</title> <para> Returns a buffered result object or &false; if an error occured. </para> </refsect1> <refsect1> <title>See also</title> <para> <function>mysqli_real_query</function>, <function>mysqli_use_result</function>. </para> </refsect1> <refsect1> <title>Example</title> <para> See <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-thread-id.xml?r=1.1&p=1 Index: phpdoc-es/reference/mysqli/functions/mysqli-thread-id.xml +++ phpdoc-es/reference/mysqli/functions/mysqli-thread-id.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.6 Maintainer: baoengb Status: ready --> <refentry id="function.mysqli-thread-id"> <refnamediv> <refname>mysqli_thread_id</refname> <refname>mysqli->thread_id</refname> <refpurpose>Regresa el identificador del THREAD para la conexión actual</refpurpose> </refnamediv> <refsect1> <title>Descripción</title> <para>Estilo por procedimientos:</para> <methodsynopsis> <type>int</type><methodname>mysqli_thread_id</methodname> <methodparam><type>objeto</type><parameter>identificador_de_enlace</parameter></methodparam> </methodsynopsis> <para>Estilo orientado a objetos (propiedad):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <fieldsynopsis><type>int</type><varname>thread_id</varname></fieldsynopsis> </classsynopsis> <para> La finción <function>mysqli_thread_id</function> regresa el identificador del THREAD para la conexión actual la cual puede ser entonces destruir usando la función <function>mysqli_kill</function>. Si la conexión se pierde y se reconecta con <function>mysqli_ping</function>, el identificador del THREAD será otro. Por lo tanto debe obtener el identificador del THREAD solo cuando lo necesite. </para> <note> <para> El identificador del THREAD es asignado en base a conexión. Por lo tanto si la conexión está rota y entonces se reestablece se le asignará un nuevo identificador de THREAD. </para> <para> Para destruir una consulta que se está ejecutando use el comando SQL <literal>KILL QUERY processid</literal>. </para> </note> </refsect1> <refsect1> <title>Valores regresados</title> <para> <function>mysqli_thread_id</function> regresa el identificador del THREAD para la conexión actual. </para> </refsect1> <refsect1> <title>Vea también</title> <para> <function>mysqli_kill</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(); } /* determine our thread id */ $thread_id = $mysqli->thread_id; /* Kill connection */ $mysqli->kill($thread_id); /* This should produce an error */ if (!$mysqli->query("CREATE TABLE myCity LIKE City")) { printf("Error: %s\n", $mysqli->error); exit; } /* 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(); } /* determine our thread id */ $thread_id = mysqli_thread_id($link); /* Kill connection */ mysqli_kill($link, $thread_id); /* This should produce an error */ if (!mysqli_query($link, "CREATE TABLE myCity LIKE City")) { printf("Error: %s\n", mysqli_error($link)); exit; } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> <para> Los ejemplos anteriores producirán la siguiente salida: </para> <screen> <![CDATA[ Error: MySQL server has gone away ]]> </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-thread-safe.xml?r=1.1&p=1 Index: phpdoc-es/reference/mysqli/functions/mysqli-thread-safe.xml +++ phpdoc-es/reference/mysqli/functions/mysqli-thread-safe.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.4 Maintainer: baoengb Status: ready --> <refentry id="function.mysqli-thread-safe"> <refnamediv> <refname>mysqli_thread_safe</refname> <refpurpose>Regresa si se ha dado un THREAD seguro o no Returns whether thread safety is given or not</refpurpose> </refnamediv> <refsect1> <title>Descripción</title> <para>Estilo por procedimientos:</para> <methodsynopsis> <type>bool</type><methodname>mysqli_thread_safe</methodname> <void /> </methodsynopsis> <para> <function>mysqli_thread_safe</function> indica si la libreria del cliente ha sido compilada como thread seguro. </para> </refsect1> <refsect1> <title>Valores regresados</title> <para> &true; si la libreria del client es thread seguro, en otro caso &false;. </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-use-result.xml?r=1.1&p=1 Index: phpdoc-es/reference/mysqli/functions/mysqli-use-result.xml +++ phpdoc-es/reference/mysqli/functions/mysqli-use-result.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.8 Maintainer: baoengb Status: ready --> <refentry id="function.mysqli-use-result"> <refnamediv> <refname>mysqli_use_result</refname> <refname>mysqli->use_result</refname> <refpurpose>Inicia una recuperación de un resultado</refpurpose> </refnamediv> <refsect1> <title>Descripción</title> <para>Estilo por procedimientos:</para> <methodsynopsis> <type>mixto</type><methodname>mysqli_use_result</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>mixto</type> <methodname>use_result</methodname> <void /> </methodsynopsis> </classsynopsis> <para> <function>mysqli_use_result</function> es usada para iniciar la recuperación de un resultado de la última consulta ejecutada usando la función <function>mysqli_real_query</function> en la conexión de base de datos específicda por el parámetro <parameter>identificador_de_enlace</parameter>. Esta o la funció <function>mysqli_store_result</function> debe ser llamada antes de que el resultado de una consulta pueda ser recuperado, y una o la otra debe esr llamada para prevenir que falle la siguiente consulta en la conexión a la base de datos. </para> <note> <para> La función <function>mysqli_use_result</function> no transfiere el resultado completo de la base de datos y por lo tanto no puede ser usadas funciones tales como <function>mysqli_data_seek</function> para moverse a una fila indicada en el resultado. Para usar esta funcionalidad, el resultado debe ser almacenado usando <function>mysqli_store_result</function>. No se debe usar <function>mysqli_use_result</function> si se está haciendo demasiado procesamiento en el lado del cliente, puesto que esto sobrecargará el servidor y evitará que otros procesos puedan actualizar cualquier tabla de entre las cuales los datos están siendo obtenidos. </para> </note> </refsect1> <refsect1> <title>Valores regresados</title> <para> Regresa el objeto resultante sin almacenamiento intermedio o &false; si ha ocurrido un error. </para> </refsect1> <refsect1> <title>Vea también</title> <para> <function>mysqli_real_query</function>, <function>mysqli_store_result</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(); } $query = "SELECT CURRENT_USER();"; $query .= "SELECT Name FROM City ORDER BY ID LIMIT 20, 5"; /* execute multi query */ if ($mysqli->multi_query($query)) { do { /* store first result set */ if ($result = $mysqli->use_result()) { while ($row = $result->fetch_row()) { printf("%s\n", $row[0]); } $result->close(); } /* print divider */ if ($mysqli->more_results()) { printf("-----------------\n"); } } while ($mysqli->next_result()); } /* 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(); } $query = "SELECT CURRENT_USER();"; $query .= "SELECT Name FROM City ORDER BY ID LIMIT 20, 5"; /* execute multi query */ if (mysqli_multi_query($link, $query)) { do { /* store first result set */ if ($result = mysqli_use_result($link)) { while ($row = mysqli_fetch_row($result)) { printf("%s\n", $row[0]); } mysqli_free_result($result); } /* print divider */ if (mysqli_more_results($link)) { printf("-----------------\n"); } } while (mysqli_next_result($link)); } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> <para> Los ejemplos anteriores producián la siguiente salida: </para> <screen> <![CDATA[ my_user@localhost ----------------- Amersfoort Maastricht Dordrecht Leiden Haarlemmermeer ]]> </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 --> <!-- 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-warning-count.xml?r=1.1&p=1 Index: phpdoc-es/reference/mysqli/functions/mysqli-warning-count.xml +++ phpdoc-es/reference/mysqli/functions/mysqli-warning-count.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.5 Maintainer: baoengb Status: ready --> <refentry id="function.mysqli-warning-count"> <refnamediv> <refname>mysqli_warning_count</refname> <refname>mysqli->warning_count</refname> <refpurpose>Regresa el número de alertas de la última consulta para el identificador de enlace dado</refpurpose> </refnamediv> <refsect1> <title>Descripción</title> <para>Estilo por procedimientos:</para> <methodsynopsis> <type>int</type><methodname>mysqli_warning_count</methodname> <methodparam><type>objeto</type><parameter>identificador_de_enlace</parameter></methodparam> </methodsynopsis> <para>Estilo orientado a objetos (propiedad):</para> <classsynopsis> <ooclass><classname>mysqli</classname></ooclass> <fieldsynopsis><type>int</type><varname>warning_count</varname></fieldsynopsis> </classsynopsis> <para> <function>mysqli_warning_count</function> regresa el número de alertas de la última consulta en la conexión representada por el parámetro <parameter>identificador_de_enlace</parameter>. </para> <note> <para> Para recuperar los mensajes de alerta, puede usar el comando SQL <literal>SHOW WARNINGS [limit row_count]</literal>. </para> </note> </refsect1> <refsect1> <title>Valores regresados</title> <para> El Número de alertas o cero si no hay alertas. </para> </refsect1> <refsect1> <title>Vea también</title> <para> <function>mysqli_errno</function>, <function>mysqli_error</function>, <function>mysqli_sqlstate</function> </para> </refsect1> <refsect1> <title>Ejemplo</title> <example> <title>Estilo orientado a objetos</title> <programlisting role="php"> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $mysqli->query("CREATE TABLE myCity LIKE City"); /* a remarkable city in Wales */ $query = "INSERT INTO myCity (CountryCode, Name) VALUES('GBR', 'Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch')"; $mysqli->query($query); if ($mysqli->warning_count) { if ($result = $mysqli->query("SHOW WARNINGS")) { $row = $result->fetch_row(); printf("%s (%d): %s\n", $row[0], $row[1], $row[2]); $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(); } mysqli_query($link, "CREATE TABLE myCity LIKE City"); /* a remarkable long city name in Wales */ $query = "INSERT INTO myCity (CountryCode, Name) VALUES('GBR', 'Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch')"; mysqli_query($link, $query); if (mysqli_warning_count($link)) { if ($result = mysqli_query($link, "SHOW WARNINGS")) { $row = mysqli_fetch_row($result); printf("%s (%d): %s\n", $row[0], $row[1], $row[2]); mysqli_free_result($result); } } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> <para> Los ejemplos anteriores producián la siguiente salida: </para> <screen> <![CDATA[ Warning (1264): Data truncated for column 'Name' at row 1 ]]> </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 -->