The mysqli_fetch_field() function returns the next field (column) in the result set, as an object.
mysqli_fetch_field(result);
name); printf("Table: %s\n",$fieldinfo->table); printf("max. Len: %d\n",$fieldinfo->max_length); } // Free result set mysqli_free_result($result); } mysqli_close($con); ?>