the code below show the result from table, when i click the view button, it should pass the value to the next form, but the next form does not show any result, don't know why. can anybody help me?
<? $Connect = mysql_connect("localhost","root","");
mysql_select_db("mw");
$result=mysql_query("select * from LeaveApplication");
$number_of_array = mysql_num_rows($result);
print "<TABLE CELLSPACING=\"0\" CELLPADDING=\"0\" BORDER=\"1\" align=\"center\">\n";
print " <TR><TD width=\"25%\" align=\"center\">Staff ID</TD><TD width=\"25%\" align=\"center\">Leave Type</TD><TD width=\"25%\" align=\"center\">Job Title</TD><TD width=\"25%\" align=\"center\">Action</TD></TR>\n";
while ($number_of_array = mysql_fetch_array($result)){
$StaffID = "number_of_array[$StaffID]";
echo "<tr>\n";
echo "<TD width=\"25%\" align=\"center\">$number_of_array[StaffID]</TD>\n";
echo "<TD width=\"25%\" align=\"center\">$number_of_array[LeaveType]</TD>\n";
echo "<TD width=\"25%\" align=\"center\">$number_of_array[JobTitle]</TD>\n";
echo "<TD width=\"25%\" align=\"center\"><form name=\"form1\" method=\"post\" action=\"view_staffleave.php\"><input type=\"submit\" name=\"Submit\" value=\" View \"></TD>\n";
echo "<tr>\n";
}
mysql_close();
?>
next form
<? $Connect = mysql_connect("localhost","root","");
mysql_select_db("mw");
$result=mysql_query("select * from LeaveApplication where StaffID = '$StaffID'") ;
$number_of_array = mysql_num_rows($result);
while ($number_of_array = mysql_fetch_array($result)){
echo "$number_of_array[StaffID]";
}
mysql_close();
?>
<? $Connect = mysql_connect("localhost","root","");
mysql_select_db("mw");
$result=mysql_query("select * from LeaveApplication where StaffID = '$StaffID'") ;
$number_of_array = mysql_num_rows($result);
while ($number_of_array = mysql_fetch_array($result)){
echo "$number_of_array[LeaveType]";
}
mysql_close();
?>
<? $Connect = mysql_connect("localhost","root","");
mysql_select_db("mw");
$result=mysql_query("select * from LeaveApplication where StaffID = '$StaffID'") ;
$number_of_array = mysql_num_rows($result);
while ($number_of_array = mysql_fetch_array($result)){
echo "$number_of_array[JobTitle]";
}
mysql_close();
?>