hofdiggity Posted September 29, 2008 Share Posted September 29, 2008 Hello, I am looking into PokerMax Poker League PHP Script (http://www.stevedawson.com/pokermax-poker-league.php), and I am looking into modifying one file (players-to-tournaments.php). Here is the issue: Currently, the admin can only add one playerid to a specified tournament per submission. I would like to be able to either checkbox or highlight multiple playerids to a specified tournament per submission. Here is the form: <form method="post"> <input name="op" type="hidden" value="AssignPlayer"> <select name="playerid" size="1"> <option value="">Select Player ....</option> <?PHP $rows = $sql->execute ( "SELECT * FROM " . $player_table . " ORDER BY playerid ASC", SQL_RETURN_ASSOC ); for ( $i = 0; $i < sizeof ( $rows ); ++$i ) { $row = $rows [ $i ]; ?> <option value="<?php echo $cgi->htmlEncode ( $row [ "playerid" ] ); ?>"> <?php echo $cgi->htmlEncode ( $row [ "playerid" ] ); ?> - <?php echo $cgi->htmlEncode ( $row [ "name" ] ); ?> </option> <?php } ?> </select> <em>and assign to the tournament =></em> <select name="tournamentid" size="1"> <option value="">Select Tournament ....</option> <?PHP $rows = $sql->execute ( "SELECT * FROM " . $tournament_table . " ORDER BY id DESC", SQL_RETURN_ASSOC ); for ( $i = 0; $i < sizeof ( $rows ); ++$i ) { $row = $rows [ $i ]; ?> <option value="<?php echo $cgi->htmlEncode ( $row [ "tournamentid" ] ); ?>"> <?php echo $cgi->htmlEncode ( $row [ "tournament_name" ] ); ?> </option> <?php } ?> </select> <input type="submit" value="Assign Player" ONCLICK="return confirm('Are you sure you want to add this player to the tournament?');" /> </form> This is the action: <?php if ( $cgi->getValue ( "op" ) == "AssignPlayer" ) { $result = mysql_query("SELECT playerid FROM ".$score_table." WHERE playerid = " . $sql->quote ( $cgi->getValue ( "playerid" ) ) . " AND tournamentid = " . $sql->quote ( $cgi->getValue ( "tournamentid" ) ) . "") or die ("$DatabaseError"); $chkd_email = mysql_numrows($result); if ($chkd_email != "") { print "<p class=\"red\"><strong>The Player has already been assigned to this tournament</strong></p>"; } else { mysql_query("INSERT INTO ".$score_table." VALUES ( '', " . $sql->quote ( $cgi->getValue ( "playerid" ) ) . ", " . $sql->quote ( $cgi->getValue ( "tournamentid" ) ) . ", '0', '$dateadded' )") or die ("$DatabaseError"); ?> <br> <p align="center" class="red">The player <strong><?php echo $_POST['playerid']; ?></strong> has been assigned to the poker tournament.</p> <?php } } ?> Thank you for your time and consideration. Quote Link to comment https://forums.phpfreaks.com/topic/126260-trying-to-allow-multiple-id-processing-with-one-submission/ Share on other sites More sharing options...
Adam Posted September 29, 2008 Share Posted September 29, 2008 Don't think anyone will just do it for you. If you do want someone to do it for you then I'd ask in the freelance section... Quote Link to comment https://forums.phpfreaks.com/topic/126260-trying-to-allow-multiple-id-processing-with-one-submission/#findComment-652864 Share on other sites More sharing options...
hofdiggity Posted September 29, 2008 Author Share Posted September 29, 2008 Thanks for the help m8! Quote Link to comment https://forums.phpfreaks.com/topic/126260-trying-to-allow-multiple-id-processing-with-one-submission/#findComment-652866 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.