Hi,
I'm new to php and i'm trying to build simple database and I having a problem with getting id value with $_GET here is snippet of my code:
$id = (int)$_GET['id'];
echo $id;
if(isset($_POST['upd'])){
$sql = "UPDATE dvds SET title = ?, folder = ?, spot = ? WHERE id = ?";
$q= $db->prepare($sql);
$q->execute(array($_POST['title'],$_POST['folder'],$_POST['spot'], $id));
}
after last echo i am getting value that i want
But when i want to pass it to my query variable $id is empty I dont know what i am missing here
Thanks in advance.