Hello there I have some problem with my code:
if (!empty($_GET['id'])){
$id = $_GET['id'];
}else if (!empty($_POST['id'])){
$id = $_POST['id'];
}
$get_id = 'SELECT * FROM kunde WHERE id=' . $id;
$r = mysql_query($get_id);
$t = mysql_fetch_array($r);
$_SESSION['id'] = $t['id'];
I also have my hidden field:
<input type="hidden" name="id" value="<?php echo $_SESSION['id']; ?>">
But I got always the same error:
Notice: Undefined variable: id in C:\xampp\htdocs\Uebungsklausur\PHP\change.php on line 30
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\Uebungsklausur\PHP\change.php on line 32
Please help me guys.. I just want to get the ID's from the table "kunde"
EDIT: Thank you guys I solved it. The problem was in the form tag. That was the first code: <form method="post">
And now it's: '<form method="post" action=" change.php?id=' . $row[0] . '">';