- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
$mysql = new mysqli($host, $db_user, $db_pass, $db_name);
mysqli_set_charset($mysql, "utf8");
$region = mysqli_query($mysql, "SELECT * FROM `rubric_subsection`");
while ($rows_rubriki = mysqli_fetch_array($region))
{
// $razdel = mysqli_query($mysql, "SELECT * FROM `city_region` LIMIT 1");
//while ($raz = mysqli_fetch_array($razdel)) {
$rubriki = mysqli_query($mysql, "SELECT `region`, `subsection`, COUNT(region) as count FROM `big_baza` where `region` = 'Республика Бурятия' AND `subsection` = '".$rows_rubriki['name']."'");
$data = mysqli_fetch_assoc($rubriki);
echo ''.$rows_rubriki['name'].' / '.$data['count'].'<br>';
//mysqli_query($mysql, "INSERT INTO `calculator_region`(`id`, `region_id`, `subsection_id`, `count`) VALUES ('','".$raz['id']."','".$rows_rubriki['id']."','".$data['count']."')");
// }
}