I can't update the data in my database, but it shows that the data is key in successfully,also i have several errors, but i don't how to to correct them, as i'm new to php..please help me out.
My firstform.php :
<?php
session_start();
include 'connect.php';
$query = mysql_query("SELECT *FROM firstform WHERE $id='$_SESSION[manager_name]'");
while($row = mysql_fetch_assoc($query))
{
$manager =$row['manager_name'];
$evaluator =$row['evaluator_name'];
$outlet =$row['outlet_location'];
$date =$row['date'];
$day =$row['day'];
$timein =$row['time_in'];
$timeout =$row['time_out'];
$overall=$row['overall'];
$quality=$row['quality'];
$service=$row['service'];
$cleanliness=$row['cleanliness'];
}
?>
This is my updatefirstform.php :
<?php
//error_reporting(0);
include'connect.php';
session_start();
$manager =$_POST['manager_name'];
$evaluator =$_POST['evaluator_name'];
$outlet =$_POST['outlet_location'];
$date =$_POST['date'];
$day =$_POST['day'];
$timein =$_POST['time_in'];
$timeout =$_POST['time_out'];
$overall=$_POST['overall'];
$quality=$_POST['quality'];
$service=$_POST['service'];
$cleanliness=$_POST['cleanliness'];
mysql_query("UPDATE firstform SET id ='$id' manager_name='$manager', evaluator_name ='$evaluator',outlet_location='$outlet',date='$date',day='$day',time_in ='$timein',time_out='$timeout',overall='$overall',quality='$quality',service='$service',cleanliness='$cleanliness' WHERE $id ='$_SESSION[manager_name]'");
echo ("<SCRIPT LANGUAGE ='JavaScript'>
window.alert ('Data are Sucessfully Updated!')
window.location.href ='secondform.php'
</SCRIPT>");
?>
The errors:
Errors :Notice: Undefined variable: manager in C:\xampp\htdocs\marrybrown_clean\firstform.php on line 4
Notice: Undefined index: manager_name in C:\xampp\htdocs\marrybrown_clean\firstform.php on line 4
Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\marrybrown_clean\firstform.php on line 6