mesaj uygulamamda veritabanındaki kayıtlı id yi düzenleme yapamıyorum, yardımlarınızı bekliyorum
canlidestek.php
<?php
$id = $gvn->rakam($_GET["id"]);
$iletisimsor=$db->prepare("SELECT * from canldest where ilet_dil=:ilet_dil");
$iletisimsor->execute(array('ilet_dil' => $dil));
$iletisimcek=$iletisimsor->fetch(PDO::FETCH_ASSOC);
$iletisimdeger=$iletisimsor->rowCount();
?>
<div class="content">
<div class="container">
<div class="row">
<div class="col-sm-12">
<h4 class="pull-left page-title"><?php if ($iletisimdeger!=0) {?><?php echo "Canlı Destek Güncelleme Ayarları";?><?php }else{?><?php echo "Canlı Destek Kayıt Ayarları";?><?php } ?></h4>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-body">
<form action="datakayit.php?p=canlidestek" id="forms" class="form-horizontal" method="POST" enctype="multipart/form-data">
<input type="hidden" name="ilet_dil" value="<?=$dil;?>">
<input type="hidden" name="id" value="<?php echo $iletisimcek['id']; ?>">
<div id="form_status"></div>
<div class="col-md-12">
<div class="col-md-7">
<select class="form-control" name="ilet_ad">
<option value="0" <?php if ($iletisimcek['ilet_ad']==0){ echo "selected";}?>><?php echo "Uygulama Yok";?></option>
<option value="1" <?php if ($iletisimcek['ilet_ad']==1){ echo "selected";}?>><?php echo "Facebook-Messenger";?></option>
<option value="2" <?php if ($iletisimcek['ilet_ad']==2){ echo "selected";}?>><?php echo "WhatsApp";?></option>
<option value="3" <?php if ($iletisimcek['ilet_ad']==3){ echo "selected";}?>><?php echo "Viber";?></option>
<option value="4" <?php if ($iletisimcek['ilet_ad']==4) { echo "selected";} ?>><?php echo "Snapchat";?></option>
<option value="5" <?php if ($iletisimcek['ilet_ad']==5){ echo "selected";} ?>><?php echo "Line";?></option>
<option value="6" <?php if ($iletisimcek['ilet_ad']==6){ echo "selected";} ?>><?php echo "Telegram";?></option>
<option value="7" <?php if ($iletisimcek['ilet_ad']==7){ echo "selected";} ?>><?php echo "Vkontakte";?></option>
<option value="8" <?php if ($iletisimcek['ilet_ad']==8){ echo "selected";} ?>><?php echo "Sms";?></option>
<option value="9" <?php if ($iletisimcek['ilet_ad']==9){ echo "selected";} ?>><?php echo "Telefon";?></option>
<option value="10" <?php if ($iletisimcek['ilet_ad']==10){ echo "selected";} ?>><?php echo "Email";?></option>
</select>
</div>
<div class="col-md-5">
<input type="text" name="ilet_deger" class="form-control" value="<?php echo $iletisimcek['ilet_deger'];?>">
</div>
</div>
<?php
if ($iletisimdeger!=0){ ?>
<div class="form-group text-center">
<button type="submit" onclick="AjaxFormS('forms','form_status');" name="mesduzenle" class="btn waves-effect waves-light btn-mat btn-primary"><?php echo "Güncelle";?></button>
</div>
<?php } else { ?>
<div class="form-group text-center">
<button type="submit" onclick="AjaxFormS('forms','form_status');" name="meskaydet" class="btn waves-effect waves-light btn-mat btn-primary"><?php echo "Kaydet";?></button>
</div>
<?php } ?>
</form>
</div>
</div>
</div>
</div>
</div>
</div>-------------------------------Post Ettiğim kodlarım
<?php
if (isset($_POST["meskaydet"])){
$ilet_ad = $gvn->html_temizle($_POST["ilet_ad"]);
$ilet_deger = $gvn->rakam($_POST["ilet_deger"]);
$ilet_yon = $gvn->rakam($_POST["ilet_yon"]);
$sql = $db->prepare("INSERT INTO canldest SET ilet_ad=?,ilet_deger=?,ilet_yon=?,ilet_dil=?");
$sql->execute(array($ilet_ad,$ilet_deger,$ilet_yon,$dil));
if($sql){
$fonk->tamam("Canlı Destek Kayıt Edildi.");
}else{
$fonk->hata("Bir hata oluştu.");
}
}
if (isset($_POST["mesduzenle"])){
$id = $gvn->rakam($_GET["id"]);
$ilet_ad = $gvn->html_temizle($_POST["ilet_ad"]);
$ilet_deger = $gvn->rakam($_POST["ilet_deger"]);
$ilet_yon = $gvn->rakam($_POST["ilet_yon"]);
$sql = $db->prepare("UPDATE canldest SET ilet_ad=?,ilet_deger=?,ilet_yon=? WHERE id='".$id."'");
$sql->execute(array($ilet_ad,$ilet_deger,$ilet_yon));
if($sql){
$fonk->tamam("Canlı Destek Düzenlendi.");
}else{
$fonk->hata("Bir hata oluştu.");
}
}
?>
