najmun
06-20-03, 03:37 AM
i wanna delete a user in the employee table
this is deleted.php
<html>
<head>
<title> The Deleted Employee</title>
</head>
<body>
<?php
$db=mysql_connect("midc01","mmu","mmu4midc");
$dblink=mysql_select_db("CMS",$db);
$result=mysql_query("select * from EMPLOYEE where EMP_ID="."$emp_id.",$db);
$numrow=mysql_num_rows($result);
if($numrow>0)
{
mysql_query("delete * from EMPLOYEE where EMP_ID="."$emp_id",$db);
print("The Employee have been successfully deleted");
}
else print("There is no employee with that particular number");
?>
</body>
</html>
this is referred by del.html
<html>
<head>
<title>Delete An Employee></title>
</head>
<body><center>
<form method="POST" action="deleted.php">
<td align="centre">To DELETE AN EMPLOYEE FROM DATABASE</td><br>
<td align="centre">KEY IN THE EMPLOYEE ID</td>
<br>
<br>
Employee ID<input type="text" name="employee_id">
<br>
<br>
<input type="submit" name="submit" value="DELETE">
</form></center>
</body>
</html>
help !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
just new to php
this is deleted.php
<html>
<head>
<title> The Deleted Employee</title>
</head>
<body>
<?php
$db=mysql_connect("midc01","mmu","mmu4midc");
$dblink=mysql_select_db("CMS",$db);
$result=mysql_query("select * from EMPLOYEE where EMP_ID="."$emp_id.",$db);
$numrow=mysql_num_rows($result);
if($numrow>0)
{
mysql_query("delete * from EMPLOYEE where EMP_ID="."$emp_id",$db);
print("The Employee have been successfully deleted");
}
else print("There is no employee with that particular number");
?>
</body>
</html>
this is referred by del.html
<html>
<head>
<title>Delete An Employee></title>
</head>
<body><center>
<form method="POST" action="deleted.php">
<td align="centre">To DELETE AN EMPLOYEE FROM DATABASE</td><br>
<td align="centre">KEY IN THE EMPLOYEE ID</td>
<br>
<br>
Employee ID<input type="text" name="employee_id">
<br>
<br>
<input type="submit" name="submit" value="DELETE">
</form></center>
</body>
</html>
help !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
just new to php