en el foreach estas creando cada tabla con un solo campo k
se me ocurre algo asi
Código PHP:
<?php
for($i = $dd; $i<$hh; $i+=86400){
$anio = date('Y-m-d', $i);
$table = 'anio'.$id.''.$y;
foreach($id_hab as $k => $v){
$cols .= "id_pro_". $k ." float(4.2),";
}
$query = mysql_query("create table $table (id_fecha int(11)auto_increment primary key, fecha date not null, ". $cols ." active int(1))", $GLOBALS['DB']) or die (mysql_error());
echo date('Y-m-d', $i);
echo '<br />';
}
?>