PHP: Put all fields metadata in array

$connection = mysql_connect($host, $user, $password);

$db = mysql_select_db(“address”, $connection);

$fieldname = array();

$result = mysql_list_fields(“address”, “address”);

$no_fields = mysql_num_fields($result);

for ($i = 0; $i < $no_fields; $i++) $fieldname[$i] = mysql_field_name($result, $i);

mysql_free_result($result);

mysql_list_fields(“$db”, “$table”);

mysql_num_fields($result);

mysql_field_name($result, $i);

mysql_field_type($result, $i);