Klein Source Code

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">  * @version   1.0 * @package   default * */ ?>  CPSC225 CPSC 225 Members List <?php //boolean variable that will be used to make each email address a hyperlink global $first_time = true;

/**     * Function showerror,  function that displays sql errors *     *  @param void * @access public * @return void */  function showerror {     die("Error " . mysql_errno . " : " . mysql_error); }

// (1) Open the database connection if (!($connection = @ mysql_connect("localhost","root",""))) die("Could not connect");

// (2) Select the cpsc database if (!(@ mysql_select_db("cpsc225", $connection))) showerror;

//query the cpsc225 database $query = "SELECT members.email, members.full_name, members.school, members.role, teams.team_name, schools.state FROM members, schools, teams WHERE members.school = schools.school and teams.team_num = members.team_num ORDER BY email"; // Run the query on the connection

if (!($result = @ mysql_query ($query, $connection))) showerror;

// Display the results displayStudents($result); /**     * Function displayStudents,  function that displays the results of the mySQL query of the cpsc225 database *     *      *  @param array $result - data from query of cpsc225 database * @access public * @return void */ function displayStudents($result) {    // Start a table, with column headers print "\n \n"; }//end function ?>