FOR FORM // Add record if ($newStudent == "Y") { // Variables initialized $fnameStudent = ""; $lnameStudent = ""; $address1Student = ""; $address2Student = ""; $townStudent = ""; $zipStudent = ""; $phoneStudent = ""; $emailStudent = ""; $fkNetidstudent = ""; $status = ""; $college = ""; $program = ""; $graddate = ""; $rsrcharea = ""; $affiliation = ""; $rsrchindependent = ""; $rsrchother = ""; } // Edit record else { // STUDENT info is assigned to variables using "variable variable": each col value is put // into its variable ($pkNetidStudent, $fnameStudent, $lnameStudent, $address1Student, // $address2Student, $townStudent, $zipStudent, $phoneStudent, $emailStudent) $query = "SELECT * FROM tblStudent WHERE pkNetidStudent = '$pkNetidStudent'"; $result = mysql_query("$query") or die('Error: Seminar query failed.'); while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) { $i = 0; foreach ($line as $col_value) { $field = mysql_field_name($result,$i); $array[$field] = $col_value; $i++; } } while (list($key, $value) = each($array)) { $$key = ${'value'}; } // STATUS info is assigned to variables using "variable variable": each col value is put // into its variable ($fkNetidstudent, $pkConfyear, $status, $college, $program, $graddate, // $rsrcharea, $affiliation, $rsrchindependent, $rsrchother) $query = "SELECT * FROM tblStatus WHERE fkNetidstudent='$pkNetidStudent' AND pkConfyear='$pkConfyear'"; $result = mysql_query("$query") or die('Error: Seminar query failed.'); while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) { $i = 0; foreach ($line as $col_value) { $field = mysql_field_name($result,$i); $array[$field] = $col_value; $i++; } } while (list($key, $value) = each($array)) { $$key = ${'value'}; } } */