1. PHP / Говнокод #28082

    +1

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 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']."')");
    
    //	}
    
    }

    Запостил: dlyaspama7771, 16 Марта 2022

    Комментарии (2) RSS

    Добавить комментарий