• 18-04-2020, 01:40:40
    #1
    Üyeliği durduruldu
    Alıntı

    <select id="country" name="country" class="form-control custom-select" required>
    <?php
    if($c_done == 1){
    $ctr = $db->QueryFetchArray("SELECT country,code FROM `list_countries` WHERE `code`='".$country."'");
    echo '<option value="'.$ctr['code'].'">'.$ctr['country'].'</option>';
    }else{
    $countries = $db->QueryFetchArrayAll("SELECT country,code FROM `list_countries` ORDER BY country ASC");
    echo '<option value="0">Ülke</option>';
    foreach($countries as $country){
    echo '<option value="'.$country['code'].'">'.$country['country'].'</option>';
    }
    }
    ?>
    </select>
    merhaba değerli kullanıcılar , varsayılan ülke olarak türkiye olarak işaretli kalsın türkiyeyi aramasınlar istiyorum ne yapmam gerekir mysql üzerinden mi php üzerinden oynama ile yapabilir miyim
  • 18-04-2020, 02:00:02
    #2
    echo "<option value="'.$country['code'].'" "if($country['code'] == 'TR' ? echo 'selected' :  '')">'.$country['country'].'</option>";
    country code TR ye eşitse selected yapabilir siniz...