请问修改功能怎么加啊,实在是不会了,求帮忙。
这是我写的php代码,求修改功能,我实在是不会了。
<html>
<head>
<title>Select Person</title>
</head>
<body>
<h1>Select Person</h1>
<form method="post";>
<table>
<tr>
<td align="left">ID:</td>
<td align="right">
<input type="text" name="id" size="8" maxlength="8"/>
</td>
</tr>
<tr>
<td align="left">Sex:</td>
<td align="right">
<input type="checkbox" name="sex" value="1" /> Male
<input type="checkbox" name="sex" value="2" /> Female
</td>
</tr>
<tr>
<td align="center">
<input type="submit" name="submit" value="select" />
</td>
</tr>
</table>
</form>
<?php
$submit = $_POST['submit'];
$id = $_POST['id'];
$sex = $_POST['sex'];
$row[] = $_POST['row'];
$db = mysql_connect("localhost","root","root");
if (!$db)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("aa", $db);
$result1 = mysql_query("select *
from mstemployeebasic where EmployeeManagementID='".$id."' limit 0,30");
$result2 = mysql_query("select *
from mstemployeebasic where EmployeeSex='".$sex."'
");
mysql_close($db);
echo "<table border='1'>
<tr>
<th>EmployeeManagementID</th>
<th>EmployeeCode</th>
<th>EmployeeName</th>
<th>EmployeeName_English</th>
<th>EmployeeSex</th>
<th>Button</th>
</tr>";
while($row = mysql_fetch_array($result1))
{
echo "<tr>";
echo "<td>" . $row['EmployeeManagementID'] . "</td>";
echo "<td>" . $row['EmployeeCode'] . "</td>";
echo "<td>" . $row['EmployeeName'] . "</td>";
echo "<td>" . $row['EmployeeName_English'] . "</td>";
if($sex == 1){
echo "<td>" . $row['EmployeeSex'] = 'Male'. "</td>";
} else
echo "<td>" . $row['EmployeeSex'] = 'Female'. "</td>";
?>
<form action="update.php" method="post">
<td>
<input type="submit" name="up1" value="update"/>
</td>
</form>
<form method="post">
<td>
<input type="submit" value="delete"/>
</td>
</form>
<?php
echo "</tr>";
}
while($row = mysql_fetch_array($result2))
{
echo "<tr>";
echo "<td>" . $row['EmployeeManagementID'] . "</td>";