v2.5.2
Giriş yap

Selected için gerekli kodu yerleştiremedim

pcmemo
575 defa görüntülendi

Alttaki kodu daha alttaki fonksiyonda xxxx yazan yere doğru şeklde yerleştirmeliyim.
Ama ilmim yetmedi. Yardımlarınızı rica ediyorum.

if ($c['CatID'] == $_GET['CatID]) { echo 'selected'}
<?php 

$kategori_sorgu=$db->prepare("SELECT * from tbl_kategoriler where CatID=:id");
$kategori_sorgu->execute(array( 'id' => $_GET['CatID'] ));
$kat=$kategori_sorgu->fetch(PDO::FETCH_ASSOC);

function CategoryDropDownEdit(&$output=null, $CatParID=0, $indent=null){
  global $db;
  $r = $db->prepare("SELECT CatID, KategoriAdiTR FROM tbl_kategoriler WHERE CatParID=:id");
  $r->execute(array(
    'id'  => $CatParID
  ));
  while($c = $r->fetch(PDO::FETCH_ASSOC)){
    $output .= '<option value=' . $c['CatID'] . 'xxxx>' . $indent . $c['KategoriAdiTR'] . "</option>";
    if($c['CatID'] != $CatParID){
      CategoryDropDownEdit($output, $c['CatID'], $indent . "&nbsp;&nbsp;&nbsp;&nbsp;");
    }
  }
  return $output;
}
 ?>
pcmemo
1389 gün önce

@farukdst çok teşekkür ederim. İşimi gördü. Gerçekten fonksiyon içinde kodlar beni zorluyor dğer taraflara göre.

Tekrar çok teşekkür ederim.