<button class="btn btn-danger mt-2" onClick="surucusil(<?php echo $lang_id; ?>)">Sil</button>
<script type="text/javascript">
function surucusil(id) {
Swal.fire({
title: 'Are you sure?',
text: "You won't be able to revert this!",
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, delete it!'
}).then((result) => {
if (result.isConfirmed) {
window.location.href = 'webting/sil_islem.php?kullanicisil=ok&kullanici_id='+id;
}
})
};
</script><?php
ob_start();
session_start();
include 'baglan.php';
// SİLME İŞLEMİ //
if($_GET['kullanicisil']=="ok"){
$id = ($_GET['kullanici_id']);
$select = $db->prepare("SELECT * FROM data_kullanici WHERE kullanici_id ='$id'");
$select -> execute(array($id));
$bul = $select->fetch(PDO::FETCH_ASSOC);
$resim = $bul["kullanici_resim"];
unlink("../$resim");
$sil=$db->prepare("DELETE FROM data_kullanici WHERE kullanici_id=:kullanici_id ");
$kontrol=$sil->execute(array(
'kullanici_id' => $_GET['kullanici_id']
));
if($kontrol){
header("Location:../surucu_list.php?durum=silindi");
}else{
header("Location:../surucu_list.php?durum=silinmedi");
}
}
//----BİTİŞ----//hataFatal error: Uncaught PDOException: SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens in D:xampphtdocsehliyetwebtingsil_islem.php:14 Stack trace: #0 D:xampphtdocsehliyetwebtingsil_islem.php(14): PDOStatement->execute(Array) #1 {main} thrown in D:xampphtdocsehliyetwebtingsil_islem.php on line 14
şimdiden herkese teşekkürler