poker script acting weird

Hi guys,

I have a problem with a poker script. I play once a month with my friends and add the scores via my phone to the database. it all worked fine until I started a new season and did a truncate on the score_table, and tournament_table.

step1. I add a tournament round to the database. This works fine. the tournament gets an name and tournamentid.

then I want to add players to the tournament:
[php]<?php

include “…/includes/config.php”;
if (isset($_COOKIE[“ValidUserAdmin”]))
{
require ( “…/includes/CGI.php” );
require ( “…/includes/SQL.php” );

$cgi = new CGI ();
$sql = new SQL ( $DBusername, $DBpassword, $server, $database );

if ( ! $sql->isConnected () )
{
die ( $DatabaseError );
}

?>

PokerMax Poker League :: The Poker Tournamnet League Solution <?PHP include ("header.php"); ?>
<?PHP include ("leftmenu.php"); ?>  


 PokerMax Poker League :: Assign Players to Tournaments


If you are running multiple tournaments on your website, this feature will allow you to assign any of your players to tournaments which you are running.

<?php

if ( $cgi->getValue ( “op” ) == “AssignPlayer” )
{
foreach($cgi->getValue(‘playerid’) as $player_id)
{
echo $player_id . ‘
’;
echo $tournamentid . ‘
’;

$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”>The Player has already been assigned to this tournament

”;
}
else {
}
mysql_query(“INSERT INTO “.$score_table.” VALUES (
‘’,
" . $sql->quote ( $player_id ) . “,
" . $sql->quote ( $cgi->getValue ( “tournamentid” ) ) . “,
‘0’,
‘$dateadded’
)”) or die (”$DatabaseError”);

?>

The player <?php echo implode(", ",$playerid); ?> has been assigned to the poker tournament.

<?php } } ?> <?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 ]; ?> "> <?php echo $cgi->htmlEncode ( $row [ "playerid" ] ); ?> - <?php echo $cgi->htmlEncode ( $row [ "name" ] ); ?> <?php }

?>

  and assign to the tournament =>  

Select Tournament .... <?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 ];
  
  ?>
"> <?php echo $cgi->htmlEncode ( $row [ "tournament_name" ] ); ?> <?php }

?>
  


<?PHP include ("footer.php"); ?> <?php } else { header("Location: index.php"); exit; } ?>[/php]

now I get NO DETAILS FOUND TRY AGAIN LATER.
I did echo on player and tournament ID to see what it sends and I notice that it doesnt pick the selected tournamentid but rather generates a random non existenting tournamentid. Wich does not exist and this nothing is added.

here I select the players and the tournamentid:

the tournamentid of the 5th round (wich is selected here):

the result when i select a name: (the echo in above php script):

as you can see, the ID in the echo does not match the selected tournament, in fact its random non exist.

so somehow the selected tournament does not get picked up in the php?
anyone see the problem in my php file?

Sponsor our Newsletter | Privacy Policy | Terms of Service