this is my first time posting to a forum or asking for help (i'm very new and still learning what i'm doing and all that other stuff, so if i phopah, I hope you'll forgive me and help me to understand the correct way to do everything from asking for help to implementing any help given.
I'm trying to tweak my little rpg site that my friends and anyone else who wishes is welcome to (www.xpg.us). I'm currently trying to add the ability for players to select facaulty advisors, Student Mentors and or Tutors to their character Bios. The problem i'm running into is that while they can select each - when I go to look at what's displayed, the value selected in the Faculty Advisor is displayed for all.
Here is the code for the Edit character page:
CODE
<?php
if ($moderator) {
?>
<tr>
<td width="30%" align="right" valign="top"><p>Faculty Advisor:</p></td>
<td colspan="2" valign="top"><SELECT name="ADVISOR">
<option value=""> -- none -- </option>
<?php
$testy = mysql_query("SELECT id,codename from cerebra WHERE (type='faculty' OR type='administrator' or type='staff' or type='alumni') AND approved='true' ORDER BY codename");
WHILE ($advisor = mysql_fetch_assoc($testy)) {
echo "<option value='" . $advisor["id"] . "'";
if ($record["advisor"] == $advisor["id"]) { echo " selected"; }
echo ">" . $advisor["codename"] . "</option>\n";
} // end WHILE
?>
<tr>
<td width="30%" align="right" valign="top"><p>Student Mentor:</p></td>
<td colspan="2" valign="top"><SELECT name="MENTOR">
<option value=""> -- none -- </option>
<?php
$testy = mysql_query("SELECT id,codename from cerebra WHERE (type='student') AND approved='true' ORDER BY codename");
WHILE ($mentor = mysql_fetch_assoc($testy)) {
echo "<option value='" . $mentor["id"] . "'";
if ($record["mentor"] == $mentor["id"]) { echo " selected"; }
echo ">" . $mentor["codename"] . "</option>\n";
} // end WHILE
?>
<tr>
<td width="30%" align="right" valign="top"><p>Assigned Tutor:</p></td>
<td colspan="2" valign="top"><SELECT name="TUTOR">
<option value=""> -- none -- </option>
<?php
$testy = mysql_query("SELECT id,codename from cerebra WHERE ('alumni' OR type='administrator' OR 'faculty' OR type='staff' OR type='student') AND approved='true' ORDER BY codename");
WHILE ($tutor = mysql_fetch_assoc($testy)) {
echo "<option value='" . $tutor["id"] . "'";
if ($record["tutor"] == $tutor["id"]) { echo " selected"; }
echo ">" . $tutor["codename"] . "</option>\n";
} // end WHILE
?>
</select>
</td>
</tr>
<td width="30%" align="right" valign="top"><p>Room Assignment:</p></td>
<td colspan="2" valign="top"><input type="text" name="ROOM" size="50" value="<?php echo $record["room"]; ?>"></td>
</tr>
<?php
} // end if moderator
} // end if record is student
?>
</table>
[code]
Any help would be greatly appreciated. Thanks to one and all.
-M