$username="user";
$password="password";
$database="company";
$dno=$_GET['dno'];
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT lname,salary FROM employee where dno=$dno";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
?>
Last Name |
Salary |
echo "Employees in Department $dno
";
$i=0;
while ($i < $num) {
$lname=mysql_result($result,$i,"lname");
$salary=mysql_result($result,$i,"salary");
?>
echo $lname; ?>
|
echo $salary; ?>
|
$i++;
}
?>