$username="user";
$password="password";
$database="company";
mysql_connect("host.domain.edu",$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT ssn,lname,fname FROM employee order by lname,fname";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
?>
Employees of Company
SSN |
Last Name |
First Name |
$i=0;
while ($i < $num) {
$essn=mysql_result($result,$i,"ssn");
$elname=mysql_result($result,$i,"lname");
$efname=mysql_result($result,$i,"fname");
?>
echo $essn; ?> |
echo $elname; ?> |
echo $efname; ?> |
$i++;
}
?>
Return to main page