cvs: phpdoc-es /reference/mysqli/functions mysqli-field-count.xml mysqli-field-seek.xml mysqli-field-tell.xml
| From: | Enrique Garcia Briones | Date: | Fri, 26 Mar 2004 17:09:30 +0000 |
| Subject: | cvs: phpdoc-es /reference/mysqli/functions mysqli-field-count.xml mysqli-field-seek.xml mysqli-field-tell.xml | ||
| Groups: | php.doc.es | ||
| Request: | Send a blank email to doc-es+get-555@lists.php.net to get a copy of this message | ||
baoengb Fri Mar 26 12:09:30 2004 EDT
Added files:
/phpdoc-es/reference/mysqli/functions mysqli-field-count.xml
mysqli-field-seek.xml
mysqli-field-tell.xml
Log:
Agregando traduccion
http://cvs.php.net/co.php/phpdoc-es/reference/mysqli/functions/mysqli-field-count.xml?r=1.1&p=1 Index: phpdoc-es/reference/mysqli/functions/mysqli-field-count.xml +++ phpdoc-es/reference/mysqli/functions/mysqli-field-count.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.8 Maintainer: baoengb Status: ready --> <refentry id="function.mysqli-field-count"> <refnamediv> <refname>mysqli_field_count</refname> <refname>mysqli->field_count</refname> <refpurpose>Regresa el número de columnas para la consulta más reciente</refpurpose> </refnamediv> <refsect1> <title>Descripción</title> <para>Estilo por procedimientos:</para> <methodsynopsis> <type>int</type><methodname>mysqli_field_count</methodname> <methodparam><type>objeto</type><parameter>identificador_de_enlace</parameter></methodparam> </methodsynopsis> <para>Estilo orientado a objetos (método):</para> <classsynopsis> <ooclass><classname>mysql</classname></ooclass> <methodsynopsis> <type>int</type> <methodname>field_count</methodname> <void /> </methodsynopsis> </classsynopsis> <para> Regresa el número de columnas para la más reciente consulta en la conexión representada por el parámetro <parameter>identificador_de_enlace</parameter>. Esta función puede ser usada cuando se use la función Returns the number of columns for the most recent query on the connection represented by the <parameter>link</parameter> parameter. This function can be useful when using the <function>mysqli_store_result</function> function to determine if the query should have produced a non-empty result set or not without knowing the nature of the query. </para> </refsect1> <refsect1> <title>Return values</title> <para>An integer representing the number of fields in a result set</para> </refsect1> <refsect1> <title>Example</title> <para> <example> <title>Object oriented style</title> <programlisting role='php'> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "test"); $mysqli->query( "DROP TABLE IF EXISTS friends"); $mysqli->query( "CREATE TABLE friends (id int, name varchar(20))"); $mysqli->query( "INSERT INTO friends VALUES (1,'Hartmut'), (2, 'Ulf')"); $mysqli->real_query($HTTP_POST_VARS['query']); if (mysql_field_count($link)) { /* this was a select/show or describe query */ $result = $mysqli->store_result(); /* process resultset */ $row = $result->fetch_row(); /* free resultset */ $result->close(); } /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role='php'> <![CDATA[ <?php $link = mysqli_connect("localhost", "my_user", "my_password", "test"); mysqli_query($link, "DROP TABLE IF EXISTS friends"); mysqli_query($link, "CREATE TABLE friends (id int, name varchar(20))"); mysqli_query($link, "INSERT INTO friends VALUES (1,'Hartmut'), (2, 'Ulf')"); mysqli_real_query($link, $HTTP_POST_VARS['query']); if (mysql_field_count($link)) { /* this was a select/show or describe query */ $result = mysqli_store_result($link); /* process resultset */ $row = mysqli_fetch_row($result); /* free resultset */ mysqli_free_result($result); } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> </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-field-seek.xml?r=1.1&p=1 Index: phpdoc-es/reference/mysqli/functions/mysqli-field-seek.xml +++ phpdoc-es/reference/mysqli/functions/mysqli-field-seek.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.5 Maintainer: baoengb Status: ready --> <refentry id="function.mysqli-field-seek"> <refnamediv> <refname>mysqli_field_seek</refname> <refname>result->field_seek</refname> <refpurpose> Fija el apuntador del resultado a una posicion específica </refpurpose> </refnamediv> <refsect1> <title>Descripción</title> <para>Estilo por procedimientos:</para> <methodsynopsis> <type>int</type><methodname>mysqli_field_seek</methodname> <methodparam><type>objeto</type><parameter>resultado</parameter></methodparam> <methodparam><type>int</type><parameter>fieldnr</parameter></methodparam> </methodsynopsis> <para>Estilo orientado a objetos (método):</para> <classsynopsis> <ooclass><classname>resultado</classname></ooclass> <methodsynopsis> <type>int</type> <methodname>field_seek</methodname> <methodparam><type>int</type><parameter>fieldnr</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Fija el apuntador a la posición dada. En la siguiente llamada a la función <function>mysqli_fetch_field</function>, traerá la definición de la columna asociada con esa posición. </para> <note> <para>Para encontrar el inicio de una fila, pase una posición con valor cero.</para> </note> </refsect1> <refsect1> <title>Valores regresados</title> <para> <function>mysqli_field_seek</function> Regresa la posición previa del apuntador de campo. </para> </refsect1> <refsect1> <title>Vea también</title> <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(); } $query = "SELECT Name, SurfaceArea from Country ORDER BY Code LIMIT 5"; if ($result = $mysqli->query($query)) { /* Get field information for 2nd column */ $result->field_seek(1); $finfo = $result->fetch_field(); printf("Name: %s\n", $finfo->name); printf("Table: %s\n", $finfo->table); printf("max. Len: %d\n", $finfo->max_length); printf("Flags: %d\n", $finfo->flags); printf("Type: %d\n\n", $finfo->type); $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(); } $query = "SELECT Name, SurfaceArea from Country ORDER BY Code LIMIT 5"; if ($result = mysqli_query($link, $query)) { /* Get field information for 2nd column */ mysqli_field_seek($result, 1); $finfo = mysqli_fetch_field($result); printf("Name: %s\n", $finfo->name); printf("Table: %s\n", $finfo->table); printf("max. Len: %d\n", $finfo->max_length); printf("Flags: %d\n", $finfo->flags); printf("Type: %d\n\n", $finfo->type); mysqli_free_result($result); } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> <para> Los ejemplos anteriores producirá la siguiente salida: </para> <screen> <![CDATA[ Name: SurfaceArea Table: Country max. Len: 10 Flags: 32769 Type: 4 ]]> </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-field-tell.xml?r=1.1&p=1 Index: phpdoc-es/reference/mysqli/functions/mysqli-field-tell.xml +++ phpdoc-es/reference/mysqli/functions/mysqli-field-tell.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.5 Maintainer: baoengb Status: ready --> <refentry id="function.mysqli-field-tell"> <refnamediv> <refname>mysqli_field_tell</refname> <refname>result->current_field</refname> <refpurpose> Obtiene la posición de desplazamiento del apuntador de un resultado </refpurpose> </refnamediv> <refsect1> <title>Descripción</title> <para>Estilo por procedimientos:</para> <methodsynopsis> <type>int</type><methodname>mysqli_field_tell</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>current_field</varname> </fieldsynopsis> </classsynopsis> <para> Regresa la posición del apuntador usada en la última llamada a <function>mysqli_fetch_field</function>. Este valor puede ser usada como un argumento de <function>mysqli_field_seek</function>. </para> </refsect1> <refsect1> &reftitle.returnvalues; <para> Regresa la posición actual del apuntador de campo. </para> </refsect1> <refsect1> &reftitle.seealso; <para> <function>mysqli_fetch_field</function>, <function>mysqli_field_seek</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 Name, SurfaceArea from Country ORDER BY Code LIMIT 5"; if ($result = $mysqli->query($query)) { /* Get field information for all columns */ while ($finfo = $result->fetch_field()) { /* get fieldpointer offset */ $currentfield = $result->current_field; printf("Column %d:\n", $currentfield); printf("Name: %s\n", $finfo->name); printf("Table: %s\n", $finfo->table); printf("max. Len: %d\n", $finfo->max_length); printf("Flags: %d\n", $finfo->flags); printf("Type: %d\n\n", $finfo->type); } $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(); } $query = "SELECT Name, SurfaceArea from Country ORDER BY Code LIMIT 5"; if ($result = mysqli_query($link, $query)) { /* Get field information for all fields */ while ($finfo = mysqli_fetch_field($result)) { /* get fieldpointer offset */ $currentfield = mysqli_field_tell($result); printf("Column %d:\n", $currentfield); printf("Name: %s\n", $finfo->name); printf("Table: %s\n", $finfo->table); printf("max. Len: %d\n", $finfo->max_length); printf("Flags: %d\n", $finfo->flags); printf("Type: %d\n\n", $finfo->type); } mysqli_free_result($result); } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> <para> Los ejemplos anteriores producirán la siguiente salida: </para> <screen> <![CDATA[ Column 1: Name: Name Table: Country max. Len: 11 Flags: 1 Type: 254 Column 2: Name: SurfaceArea Table: Country max. Len: 10 Flags: 32769 Type: 4 ]]> </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-field-count.xml?r=1.1&p=1 Index: phpdoc-es/reference/mysqli/functions/mysqli-field-count.xml +++ phpdoc-es/reference/mysqli/functions/mysqli-field-count.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.8 Maintainer: baoengb Status: ready --> <refentry id="function.mysqli-field-count"> <refnamediv> <refname>mysqli_field_count</refname> <refname>mysqli->field_count</refname> <refpurpose>Regresa el número de columnas para la consulta más reciente</refpurpose> </refnamediv> <refsect1> <title>Descripción</title> <para>Estilo por procedimientos:</para> <methodsynopsis> <type>int</type><methodname>mysqli_field_count</methodname> <methodparam><type>objeto</type><parameter>identificador_de_enlace</parameter></methodparam> </methodsynopsis> <para>Estilo orientado a objetos (método):</para> <classsynopsis> <ooclass><classname>mysql</classname></ooclass> <methodsynopsis> <type>int</type> <methodname>field_count</methodname> <void /> </methodsynopsis> </classsynopsis> <para> Regresa el número de columnas para la más reciente consulta en la conexión representada por el parámetro <parameter>identificador_de_enlace</parameter>. Esta función puede ser usada cuando se use la función Returns the number of columns for the most recent query on the connection represented by the <parameter>link</parameter> parameter. This function can be useful when using the <function>mysqli_store_result</function> function to determine if the query should have produced a non-empty result set or not without knowing the nature of the query. </para> </refsect1> <refsect1> <title>Return values</title> <para>An integer representing the number of fields in a result set</para> </refsect1> <refsect1> <title>Example</title> <para> <example> <title>Object oriented style</title> <programlisting role='php'> <![CDATA[ <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "test"); $mysqli->query( "DROP TABLE IF EXISTS friends"); $mysqli->query( "CREATE TABLE friends (id int, name varchar(20))"); $mysqli->query( "INSERT INTO friends VALUES (1,'Hartmut'), (2, 'Ulf')"); $mysqli->real_query($HTTP_POST_VARS['query']); if (mysql_field_count($link)) { /* this was a select/show or describe query */ $result = $mysqli->store_result(); /* process resultset */ $row = $result->fetch_row(); /* free resultset */ $result->close(); } /* close connection */ $mysqli->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role='php'> <![CDATA[ <?php $link = mysqli_connect("localhost", "my_user", "my_password", "test"); mysqli_query($link, "DROP TABLE IF EXISTS friends"); mysqli_query($link, "CREATE TABLE friends (id int, name varchar(20))"); mysqli_query($link, "INSERT INTO friends VALUES (1,'Hartmut'), (2, 'Ulf')"); mysqli_real_query($link, $HTTP_POST_VARS['query']); if (mysql_field_count($link)) { /* this was a select/show or describe query */ $result = mysqli_store_result($link); /* process resultset */ $row = mysqli_fetch_row($result); /* free resultset */ mysqli_free_result($result); } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> </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-field-seek.xml?r=1.1&p=1 Index: phpdoc-es/reference/mysqli/functions/mysqli-field-seek.xml +++ phpdoc-es/reference/mysqli/functions/mysqli-field-seek.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.5 Maintainer: baoengb Status: ready --> <refentry id="function.mysqli-field-seek"> <refnamediv> <refname>mysqli_field_seek</refname> <refname>result->field_seek</refname> <refpurpose> Fija el apuntador del resultado a una posicion específica </refpurpose> </refnamediv> <refsect1> <title>Descripción</title> <para>Estilo por procedimientos:</para> <methodsynopsis> <type>int</type><methodname>mysqli_field_seek</methodname> <methodparam><type>objeto</type><parameter>resultado</parameter></methodparam> <methodparam><type>int</type><parameter>fieldnr</parameter></methodparam> </methodsynopsis> <para>Estilo orientado a objetos (método):</para> <classsynopsis> <ooclass><classname>resultado</classname></ooclass> <methodsynopsis> <type>int</type> <methodname>field_seek</methodname> <methodparam><type>int</type><parameter>fieldnr</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Fija el apuntador a la posición dada. En la siguiente llamada a la función <function>mysqli_fetch_field</function>, traerá la definición de la columna asociada con esa posición. </para> <note> <para>Para encontrar el inicio de una fila, pase una posición con valor cero.</para> </note> </refsect1> <refsect1> <title>Valores regresados</title> <para> <function>mysqli_field_seek</function> Regresa la posición previa del apuntador de campo. </para> </refsect1> <refsect1> <title>Vea también</title> <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(); } $query = "SELECT Name, SurfaceArea from Country ORDER BY Code LIMIT 5"; if ($result = $mysqli->query($query)) { /* Get field information for 2nd column */ $result->field_seek(1); $finfo = $result->fetch_field(); printf("Name: %s\n", $finfo->name); printf("Table: %s\n", $finfo->table); printf("max. Len: %d\n", $finfo->max_length); printf("Flags: %d\n", $finfo->flags); printf("Type: %d\n\n", $finfo->type); $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(); } $query = "SELECT Name, SurfaceArea from Country ORDER BY Code LIMIT 5"; if ($result = mysqli_query($link, $query)) { /* Get field information for 2nd column */ mysqli_field_seek($result, 1); $finfo = mysqli_fetch_field($result); printf("Name: %s\n", $finfo->name); printf("Table: %s\n", $finfo->table); printf("max. Len: %d\n", $finfo->max_length); printf("Flags: %d\n", $finfo->flags); printf("Type: %d\n\n", $finfo->type); mysqli_free_result($result); } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> <para> Los ejemplos anteriores producirá la siguiente salida: </para> <screen> <![CDATA[ Name: SurfaceArea Table: Country max. Len: 10 Flags: 32769 Type: 4 ]]> </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-field-tell.xml?r=1.1&p=1 Index: phpdoc-es/reference/mysqli/functions/mysqli-field-tell.xml +++ phpdoc-es/reference/mysqli/functions/mysqli-field-tell.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.5 Maintainer: baoengb Status: ready --> <refentry id="function.mysqli-field-tell"> <refnamediv> <refname>mysqli_field_tell</refname> <refname>result->current_field</refname> <refpurpose> Obtiene la posición de desplazamiento del apuntador de un resultado </refpurpose> </refnamediv> <refsect1> <title>Descripción</title> <para>Estilo por procedimientos:</para> <methodsynopsis> <type>int</type><methodname>mysqli_field_tell</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>current_field</varname> </fieldsynopsis> </classsynopsis> <para> Regresa la posición del apuntador usada en la última llamada a <function>mysqli_fetch_field</function>. Este valor puede ser usada como un argumento de <function>mysqli_field_seek</function>. </para> </refsect1> <refsect1> &reftitle.returnvalues; <para> Regresa la posición actual del apuntador de campo. </para> </refsect1> <refsect1> &reftitle.seealso; <para> <function>mysqli_fetch_field</function>, <function>mysqli_field_seek</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 Name, SurfaceArea from Country ORDER BY Code LIMIT 5"; if ($result = $mysqli->query($query)) { /* Get field information for all columns */ while ($finfo = $result->fetch_field()) { /* get fieldpointer offset */ $currentfield = $result->current_field; printf("Column %d:\n", $currentfield); printf("Name: %s\n", $finfo->name); printf("Table: %s\n", $finfo->table); printf("max. Len: %d\n", $finfo->max_length); printf("Flags: %d\n", $finfo->flags); printf("Type: %d\n\n", $finfo->type); } $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(); } $query = "SELECT Name, SurfaceArea from Country ORDER BY Code LIMIT 5"; if ($result = mysqli_query($link, $query)) { /* Get field information for all fields */ while ($finfo = mysqli_fetch_field($result)) { /* get fieldpointer offset */ $currentfield = mysqli_field_tell($result); printf("Column %d:\n", $currentfield); printf("Name: %s\n", $finfo->name); printf("Table: %s\n", $finfo->table); printf("max. Len: %d\n", $finfo->max_length); printf("Flags: %d\n", $finfo->flags); printf("Type: %d\n\n", $finfo->type); } mysqli_free_result($result); } /* close connection */ mysqli_close($link); ?> ]]> </programlisting> </example> <para> Los ejemplos anteriores producirán la siguiente salida: </para> <screen> <![CDATA[ Column 1: Name: Name Table: Country max. Len: 11 Flags: 1 Type: 254 Column 2: Name: SurfaceArea Table: Country max. Len: 10 Flags: 32769 Type: 4 ]]> </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 -->