$board_size) { $board_size = 9; } // make sure the handicap is valid if (1 == $handicap) { $handicap = 2; } // set the turn based on handicap $turn = (0 == $handicap) ? 'Black' : 'White'; // create the new game $query = " INSERT INTO ".T_GAME." SET g_id = NULL , g_black_player_id = '{$black_id}' , g_white_player_id = '{$white_id}' , g_handicap = '{$handicap}' , g_board_size = '{$board_size}' , g_moves = '' , g_num_moves = 0 , g_status = '{$turn}' , g_last_move = 0 , g_create_date = NOW( ) "; $mysql->query($query, __LINE__, __FILE__); header('Location: index.php'); exit; } // get the player data for the player drop-down list $query = " SELECT p_id , p_username FROM ".T_PLAYER." WHERE p_id != '{$_SESSION['player_id']}' ORDER BY p_username "; $players = $mysql->fetch_array($query, __LINE__, __FILE__); $player_option_html = ''; // start the page echo "\n"; ?>