#! /usr/bin/perl

use ccbs;
use strict;
use warnings;

my $dbh = ccbs::db_connect();
my $cgi = new CGI;

my $tournament = $cgi->param('tournament');
my $nick = $cgi->param('nick');

$dbh->do('INSERT INTO players (nick) VALUES (?)', undef, $nick);
my $ref = $dbh->selectrow_hashref('SELECT player FROM players WHERE nick=?',
	undef, $nick);

ccbs::print_see_other('registration.pl?id=' . $tournament . '&player=' .
	$ref->{'player'});

$dbh->disconnect;
