• 23-02-2020, 15:27:51
    #1
    Üyeliği durduruldu
    Arkadaşlar PDO üzerinde tablo boş ise ana sayfaya attırıcam, ufak bir kod yazabilecek var mı ?
  • 23-02-2020, 15:30:22
    #2
    Web Tasarım ve Yazılım
    otukenwebtr adlı üyeden alıntı: mesajı görüntüle
    Arkadaşlar PDO üzerinde tablo boş ise ana sayfaya attırıcam, ufak bir kod yazabilecek var mı ?
    Hocam pm atın yardımcı olayım basit bir if else yapısı yapmamız gerek
  • 23-02-2020, 15:31:20
    #3
    $query = $pdo->preapre('select * from table_name');
    $query->execute();
    if($query->rowCount() == 0){
     header('location:index.php')
    }
  • 23-02-2020, 15:33:01
    #4
    $query = $pdo->prepare('select * from table_name');
    $query->execute();
    if($query->rowCount() ){
     //normal kodlar
    }else{
       header('Location:index.php');   // veri yoksa indexe at :)
    }
  • 23-02-2020, 15:34:36
    #5
    yada
    $query = $pdo->preapre('select count(*) as count from table_name');
    $query->execute();
    if($query->fetch()->count == 0){
     header('location:index.php')
    }
  • 23-02-2020, 15:38:53
    #6
    Üyeliği durduruldu
    Hocam şöyle, a tablosu içinde x sütunu boş ise gibi olursa iyi olur
  • 23-02-2020, 15:43:42
    #7
    $query = $pdo->preapre('select count(*) as count from table_name where colname = "" ');
    $query->execute();
    if($query->fetch()->count > 0){
    header('location:index.php')
    }
    bu işinizi görür o zaman @otukenwebtr;
  • 23-02-2020, 15:44:43
    #8
    Üyeliği durduruldu
    Herkese teşekkürler, tüm hepsini özelleştirip deneyeceğim.