mysql_field_len()
int mysql_field_len(results,index)
This function returns the length from a field of the results set given. Specify the desired field via the index in the second argument. Here is an example:
...
$sql_stmnt = "SELECT * FROM workreq LIMIT 1";
$results = mysql_query($sql_stmnt);
$num_fields = mysql_num_fields($results);
for ($index = 0; $index < $num_fields; $index++) {
$field_name = mysql_field_name($results, $index);
print "$field_name - " .
mysql_field_len($results, $index) . "\n";
}
...Here, one row has been retrieved from a table and
mysql_num_fields() determines the number of
fields in the results set. With a for statement,
each field is processed to determine its name using
mysql_field_name() and the length of each
field is ascertained with mysql_field_len().
Here are a few lines of the output of this script:
wrid - 9 wr_date - 10 clientid - 4 ...