( ! ) Notice: session_start(): ps_files_cleanup_dir: opendir(/var/lib/php/session) failed: Permission denied (13) in /home/prototurk.com/public_html/app/init.php on line 4
Call Stack
#TimeMemoryFunctionLocation
10.0002360144{main}( ).../index.php:0
20.0010363960require( '/home/prototurk.com/public_html/app/init.php' ).../index.php:9
30.0010380472session_start ( ).../init.php:4
koşulu yerleştirmek | Cevap #1280 - PROTOTURK
v2.5.2
Giriş yap

koşulu yerleştirmek

pcmemo
838 defa görüntülendi
function CategoryTree(&$output=null, $CatParID=0, $indent=null){
  // conection to the database
  $db = new PDO("mysql:host=localhost;dbname=spot", 'root', 'root');
  // select the categories that have on the CatParID column the value from $CatParID
  $r = $db->prepare("SELECT CatID, KategoriAdi FROM tbl_kategori WHERE CatParID=:CatParIDid");
  $r->execute(array(
    'CatParIDid'  => $CatParID
  ));
  // show the categories one by one
  while($c = $r->fetch(PDO::FETCH_ASSOC)){
    $output .= '<option value=' . $c['CatID'] . 'xxxxxxxxxxxxxxx>' . $indent . $c['KategoriAdi'] . "</option>";
    if($c['CatID'] != $CatParID){
      // in case the current category's id is different that $CatParID
      // we call our function again with new parameters
      CategoryTree($output, $c['CatID'], $indent . "---------");
    }
  }

aşağıdaki kodu yukarındaki xxxxxxxxxxxx li yere yerleştirmem lazım. Olmadı bir türlü.

  if ($c['CatID'] == $kat['CatParID']) { echo 'selected/';} 
makifgokce
1466 gün önce
$c['CatID'] == $kat['CatParID'] ? 'selected' : ''

bunu oraya yaz.
http://www.erbilen.net/ternary-uclu-operator-kullanimi-php/