ı cant change the column named oturum with this code however. the id is true but not changing the database.
<?php
include 'islemmerkezi/baglan.php';
ob_start();
session_start();
$id=$_GET['durum'];
echo "your id"; echo "<br>";
echo $id ; echo "<br>";
$kullaniciguncelle=$db->prepare("UPDATE kullanici SET
oturum=:oturum
WHERE id=@id
");
$update=$kullaniciguncelle->execute(array(
'oturum' => 0
));
session_destroy();
/*header("Location:login.php?durum=exit");*/
ob_end_flush();
?>
You need to bind the id as well. It is a variable data so you should use placeholder in SQL and then pass data in execute()
:
$kullaniciguncelle = $db->prepare("UPDATE kullanici SET oturum=:oturum WHERE id=:id");
$kullaniciguncelle->execute([
'oturum' => 0,
'id' => $_GET['durum']
]);
WHERE id=@id
after changing this to :
WHERE id={$_POST['id]}
that it worked. Thx you al