For the maximum length of a field (e.g. 10 for a VARCHAR(10) field), use mysql_field_len().
mysql_fetch_lengths
(PHP 4, PHP 5)
mysql_fetch_lengths — Ottiene la lunghezza di ogni output nel risultato
Descrizione
array mysql_fetch_lengths
( resource
$risultato
)
Restituisce un array che corrisponde alle lunghezze di ogni campo
nell'ultima riga caricata da mysql_fetch_row()
oppure FALSE in caso di errore.
mysql_fetch_lengths() memorizza le lunghezze di ogni colonna dell'ultima riga restituita da mysql_fetch_row(), mysql_fetch_array() e mysql_fetch_object() in un array, iniziando con un indice pari a 0.
Vedere anche: mysql_fetch_row().
Anonymous ¶
7 years ago
Bavo Janss ¶
3 years ago
In case of UTF8 fields mysql_field_len() will return 3 times the maximum length (e.g. 30 for a VARCHAR(10) field)) for mysql_field_len() returns the byte length of the field not the defined size.
