Join Up!
96657 members and counting!

 
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links 
search for in the  
previousmysql_field_tablemysql_free_resultnext
Last updated: Tue, 29 Oct 2002
view the printer friendly version or the printer friendly version with notes or change language to Czech | Finnish | German

mysql_field_type

(PHP 3, PHP 4 )

mysql_field_type --  Devuelve el tipo del campo especificado en un resultado

Descripción

string mysql_field_type ( int id_resultado, int offset_del_campo)

mysql_field_type() es similar a la función mysql_field_name(). Los argumentos son identicos, pero se devuelve el tipo de campo. El tipo sera "int", "real", "string", "blob", o otros detallados en la documentación de MySQL.

Ejemplo 1. mysql field types

<?php
mysql_connect("localhost:3306");
mysql_select_db("wisconsin");
$result = mysql_query("SELECT * FROM onek");
$fields = mysql_num_fields($result);
$rows   = mysql_num_rows($result);
$i = 0;
$table = mysql_field_table($result, $i);
echo "Your '".$table."' table has ".$fields." fields and ".$rows." records <BR>";
echo "The table has the following fields <BR>";
while ($i < $fields) {
    $type  = mysql_field_type  ($result, $i);
    $name  = mysql_field_name  ($result, $i);
    $len   = mysql_field_len   ($result, $i);
    $flags = mysql_field_flags ($result, $i);
    echo $type." ".$name." ".$len." ".$flags."<BR>";
    $i++;
}
mysql_close();
?>

Por razones de compatibilidad puede usarse tambien mysql_fieldtype().

User Contributed Notes
mysql_field_type
add a note about notes
There are no user contributed notes for this page.
previousmysql_field_tablemysql_free_resultnext
Last updated: Tue, 29 Oct 2002
Copyright © 2001, 2002 The PHP Group
All rights reserved.
This mirror generously provided by: http://phpbuilder.com/
Last updated: Thu Oct 31 18:34:28 2002 EST