false)))) {
die('Не могу подключиться к БД');
}
$db -> exec('SET CHARACTER SET utf8');
$selected = [];
if ($_REQUEST['action']=='submit') {
foreach($_REQUEST as $key=>$value) {
if (strpos($key,'unit_')===0) {
$group_id=intval(substr($key,5));
$unit_id=$value;
setcookie('unit_'.$group_id,$unit_id,time()+86400*365*10);
$selected[$group_id]=$unit_id;
}
}
?>
WeatherMon (Настройки)
Сохранено...
$value) {
if (strpos($key,'unit_')===0) {
$group_id=intval(substr($key,5));
$unit_id=$value;
setcookie('unit_'.$group_id,$unit_id);
$selected[$group_id]=$unit_id;
}
}
?>
WeatherMon (Настройки)
prepare(
'select id,name,(select count(*) from units where unit_group=g.id) cnt from unit_groups g'
);
$q -> execute();
echo '';
}
?>