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

    +152

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    if ($subletter) {
    	$firms = $db->getArray("SELECT `id_firm`, `id_service`, `id_city`, `name` FROM `firm` WHERE `id_city` IN (".implode(",", array_keys($cities)).") AND `name` REGEXP '^".mysql_real_escape_string($letter.$subletter)."' AND `blocked` = 0 ORDER BY name ASC");
    } 
    elseif ($letter) {
    	$firms = $db->getArray("SELECT `id_firm`, `id_service`, `id_city`, `name` FROM `firm` WHERE `id_city` IN (".implode(",", array_keys($cities)).") AND `name` REGEXP '^".mysql_real_escape_string($letter)."' AND `blocked` = 0 ORDER BY name ASC");
    }
    else $firms = array();

    Запостил: gorky, 16 Июля 2013

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

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