Mysql fetch field - Get column information from a result and return as an object.

 
Example Code:

$result = mysql_query ('select * from table');

 
Get column Metadata

		$i = 0; 
		while ($i < mysql_num_fields($result))
		{
		$meta = mysql_fetch_field($result, $i);
		echo "
		blob:         $meta->blob
		max_length:   $meta->max_length
		multiple_key: $meta->multiple_key
		name:         $meta->name
		not_null:     $meta->not_null
		numeric:      $meta->numeric
		primary_key:  $meta->primary_key
		table:        $meta->table
		type:         $meta->type
		default:      $meta->def
		unique_key:   $meta->unique_key
		unsigned:     $meta->unsigned
		zerofill:     $meta->zerofill";
		$i++;
		}