//include stylesheet for formatting include("stylesheet.php3"); ?>
// script to display who has which computers // connection information $db_name = "ancestry"; $table_name = "family"; //connect to server and select database $connection = @mysql_connect("localhost", "sneal", "metro") or die(mysql_error()); $db = @mysql_select_db($db_name, $connection) or die(mysql_error()); $space = ' '; // Select the fields from the appropriate tables $sql = "SELECT id, l_name, m_name, f_name, state, birthday, birthplace, father, mother, CONCAT(f_name,' ',l_name) fullname FROM $table_name ORDER BY l_name"; $result = @mysql_query($sql,$connection) or die(mysql_error()); //$sql2 = "SELECT id, l_name, m_name, f_name, state, birthday, birthplace, father, mother, CONCAT(f_name,' ',l_name) fullname FROM $table_name WHERE father = $fullname"; //$result2 = @mysql_query($sql,$connection) or die(mysql_error()); // Determine the number of records returned $number = mysql_numrows($result); // Print the relevant information print "| Last Name | First Name | Middle Name | State | Birthday | Birth Place | Father | Mother | Full Name |
| $l_name | $f_name | $m_name | $state | $birthday | $birthplace | $l_name | $mother | $fullname |