|
Sommaire
MySQL
mysql_affected_rows
mysql_change_user
mysql_close
mysql_connect
mysql_create_db
mysql_data_seek
mysql_db_name
mysql_db_query
mysql_drop_db
mysql_errno
mysql_error
mysql_escape_string
mysql_fetch_array
mysql_fetch_assoc
mysql_fetch_field
mysql_fetch_lengths
mysql_fetch_object
mysql_fetch_row
mysql_field_flags
mysql_field_name
mysql_field_len
mysql_field_seek
mysql_field_table
mysql_field_type
mysql_free_result
mysql_insert_id
mysql_list_dbs
mysql_list_fields
mysql_list_tables
mysql_num_fields
mysql_num_rows
mysql_pconnect
mysql_unbuffered_query
mysql_query
mysql_result
mysql_select_db
mysql_tablename
mysql_get_client_info
mysql_get_host_info
mysql_get_proto_info
mysql_get_server_info
|
6.60.24 mysql_field_typePHP 3, PHP 4 >= 4.0.0Description
string mysql_field_type(resource result_identifier ,int field_offset )
mysql_field_type est similaire à la fonction
mysql_field_name. Les arguments sont identiques, mais c'est
le type du champs qui est retourné. Il vaudra "int", "real", "string", "blob", ou
d'autres, comme détaillé dans la documentation MySQL.
| Types mysql field |
<?php mysql_connect("localhost:@:3306"); mysql_select_db("wisconsin"); $result = mysql_query("SELECT clean_docs_mysql clean_docs-php debut.php docMySQL3[1].23_v4d.tar.gz docPHP4_v5d[1].tar.gz fin.php mysql php 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 et ".$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(); ?>
|
Pour des raisons de compatibilité ascendante, mysql_fieldtype()
peut encore être utilisé.
|