I've looked around and tried numerous ways. I know I'm messing up somewhere. Anyone able to help out?
I have the selection set up like this because the usergroupid's are different for the 4 names listed...then there are 20 names with the same usergroupid that I'm trying to add to the box.
<?php
if (realpath(__FILE__) == realpath($_SERVER['SCRIPT_FILENAME'])) {
exit('<center><BR><BR><BR><h1>Access Denied</h1></center>');
}
echo "<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" style=\"background-image:url(images/themez/evasive/blockheader-center.PNG); height: 20px\">
<tr>
<td><center>Finish Match</center></td>
</tr>
</table>";
[COLOR="Red"]$sent = $_POST['Sent'];[/COLOR]
$get = $_REQUEST['picked'];
$private = $_REQUEST['id'];
if ($get != "yes") {
$nextmatch_sq = mysql_query("SELECT * FROM my_table")or die(mysql_error());
$nextmatch_sqi = mysql_fetch_array( $nextmatch_sq );
while($nextmatch_sqi = mysql_fetch_array( $nextmatch_sq)){
echo "<BR><A HREF=\"http://www.teamofgod.com/admin/index.php?name=Next_Match&file=finish&picked=yes&id=".$nextmatch_sqi['private']."\">".$nextmatch_sqi['private']." vs ".$nextmatch_sqi['private']."</A><BR>";
}
}else {
if ($sent == "yes") {
[COLOR="red"]$Roster = $_POST['Roster'];[/COLOR]
if ($Map == "------------------------------") {
echo "PLEASE CHOOSE A MAP!";
}else {
mysql_query("DELETE FROM my_table WHERE private = $private");
[EDITED OUT OTHERS]
mysql_query("INSERT INTO my_table VALUES ( '[COLOR="red"]$Roster[/COLOR]')");
echo "
<CENTER>The match has been added to the database<BR><BR><A HREF=\"index.php?name=Next_Match&file=finish&picked=yes&id=$matchid\">Click here to go back if not redirected</A></CENTER>
<META HTTP-EQUIV=\"refresh\" CONTENT=\"1\">
";
}
}else {
$nextmatch_sq2 = mysql_query("SELECT * FROM my_table WHERE private = $private")or die(mysql_error());
$nextmatch_sqi2 = mysql_fetch_array( $nextmatch_sq2 );
$DatePieces = explode(".", $nextmatch_sqi2['private']);
$private = $DatePieces[0];
$private = $DatePieces[1];
$private = $DatePieces[2];
echo "<CENTER><FORM METHOD=POST ACTION=\"index.php?name=Next_Match&file=finish&picked=yes&id=$matchid\">
<INPUT TYPE=\"hidden\" NAME=\"Sent\" VALUE=\"yes\">
<TABLE BORDER=\"0\" CELLSPACING=\"5\" CELLPADDING=\"1\">
<TR>
[.....code to long....]
<TR>
[COLOR="Red"] <TD>Roster:</TD>
<TD><SELECT NAME=\"Roster[]\" MULTIPLE=\"YES\" SIZE=\"8\">
<OPTION VALUE=\"Sneaky\">Sneaky</option>
<OPTION VALUE=\"Paper\">Paper</option>
<OPTION VALUE=\"Killa\">Killa</option>
<OPTION VALUE=\"Spray\">Spray</option>";
//ROSTER MULTIPLE SELECTION
$member_sq2 = mysql_query("SELECT * FROM my_table WHERE usergroupid = '10'")or die(mysql_error());
$member_sqi2 = mysql_fetch_array( $member_sq2 );
while($member_sqi2 = mysql_fetch_array( $member_sq2)){
if($member_sqi2['usergroupid'] == "10"){
echo "
<OPTION VALUE=\"".$member_sqi2['username']."\">".$member_sqi2['username']."</option>";
}
}
//END OF ROSTER MULTIPLE SELECTION
echo "
</SELECT>[/COLOR]
</TR>
<TR>
<TD>Summary:</TD>
<TD><TEXTAREA NAME=\"Summary\" ROWS=\"5\" COLS=\"23\" VALUE=\"".$nextmatch_sqi2['private']."\"></TEXTAREA></TD>
</TR>
<TR>
<TD>Opponent Tag:</TD>
<TD><INPUT TYPE=\"text\" NAME=\"Opponent_Tag\" SIZE=\"26\" VALUE=\"".$nextmatch_sqi2['private']."\"></TD>
</TR>
<TR>
<TD COLSPAN=\"2\"><CENTER><INPUT TYPE=\"submit\" VALUE=\"Post!\"></CENTER></TD>
</TR>
</TABLE>
[COLOR="red"] </FORM>[/COLOR]</CENTER>";
}}
?>