コード例 #1
0
function attemptToInsertIntoBalls($color, $weight, $size)
{
    $query = "INSERT INTO Ball(Color, Weight, Size) VALUES ('{$color}', {$weight}, {$size})";
    $result = attemptDataManipulationLanguageQuery($query);
    if ($result == TRUE) {
        echo '<br>Ball successfully created! You can go back to the previous page to use your new ball!';
    } else {
        echo $result;
    }
}
コード例 #2
0
    //        echo '<br>You are about to delete player number ' . $_POST['player2'];
    //        $sql = "update team set Player_2 = null where team.Team_ID = $teamID";
    //        break;
    //    case 'player3':
    //        echo '<br>You are about to delete player number ' . $_POST['player3'];
    //        $sql = "update team set Player_3 = null where team.Team_ID = $teamID";
    //        break;
    //    case 'player4':
    //        echo '<br>You are about to delete player number ' . $_POST['player4'];
    //        $sql = "update team set Player_4 = null where team.Team_ID = $teamID";
    //        break;
    //    case 'player5':
    //        echo '<br>You are about to delete player number ' . $_POST['player5'];
    //        $sql = "update team set Player_5 = null where team.Team_ID = $teamID";
    //        break;
    //    default:
    //        echo 'Invalid player!';
    //        break;
    //}
    if (attemptDataManipulationLanguageQuery($sql)) {
        echo '<br>Player Deleted';
    } else {
        echo 'Could not delete player!';
    }
}
/**
 * Created by PhpStorm.
 * User: William
 * Date: 4/22/2016
 * Time: 1:38 PM
 */
コード例 #3
0
                        echo "<br>Their player ID is: {$playerID}";
                        echo "<br>Congratulations! {$fname} {$lname} is now part of your team!";
                        echo '<br>Player has been set as #4';
                        $sql = "UPDATE team SET Player_4 = {$playerID} where team.Team_ID = {$teamID}";
                        $message = 'Player has been added to 4th player slot! You can only add one more person to your team!';
                    } elseif (!isset($row2['Player_5'])) {
                        echo 'You are trying to add the e-mail ' . $_POST['myinput'], ' to your team';
                        echo "<br>Their player ID is: {$playerID}";
                        echo "<br>Congratulations! {$fname} {$lname} is now part of your team!";
                        echo '<br>Player has been set as #5';
                        $sql = "UPDATE team SET Player_5 = {$playerID} where team.Team_ID = {$teamID}";
                        $message = 'Player has been added to 5th player slot! You are currently maxed out on other team members!';
                    } else {
                        $message = 'Your team is full, therefore you are unable to add any more players. Please remove some members off of your team if you want room to add other players.';
                        $isFull = true;
                    }
                    popupMessageAndRedirectBrowser($message);
                }
            }
        }
    }
    if (!$isFull and attemptDataManipulationLanguageQuery($sql)) {
        emailPlayer($playerID);
        echo '<br>Player Added';
    } else {
        $message = 'Unable to add the player! ';
    }
    popupMessageAndRedirectBrowser($message);
} else {
    popupMessageAndRedirectBrowser('Player does not exist! Please ensure that what you have entered is correct and valid.   ');
}