<commit_before><?php
require_once("module.php");
require_once("items.php");
require_once("notes.php");
require_once("media.php");

class Players extends Module
{	

    /**
     * Create a new Player
     * @returns player id
     */
    public function createPlayer($strNewUserName, $strPassword, $strFirstName, $strLastName, $strEmail, $strGroup = '')
    {

        $strNewUserName = addslashes($strNewUserName);	
        $strFirstName = addslashes($strFirstName);	
        $strLastName = addslashes($strLastName);	
        $strEmail = addslashes($strEmail);	

        $query = "SELECT player_id FROM players 
            WHERE user_name = '{$strNewUserName}' LIMIT 1";

        if ($obj = mysql_fetch_object(mysql_query($query))) {
            return new returnData(1, $obj->player_id, 'user exists');
        }

        $query = "INSERT INTO players (user_name, password, 
            first_name, last_name, email, created, group_name) 
            VALUES ('{$strNewUserName}', MD5('$strPassword'),
                    '{$strFirstName}','{$strLastName}','{$strEmail}', NOW(), '{$strGroup}')";

        mysql_query($query);
        if (mysql_error()) return new returnData(3, NULL, 'SQL Error');

        return new returnData(0, mysql_insert_id());
    }

    public function removePlayerFromGroup($intPlayerId)
    {
        $query = "UPDATE players SET group_name = '' WHERE player_id = '{$intPlayerId}'";<commit_msg>backtrack that last commit - this one makes more sense (can move player to group, including the null group of '')<commit_after><?php
require_once("module.php");
require_once("items.php");
require_once("notes.php");
require_once("media.php");

class Players extends Module
{	

    /**
     * Create a new Player
     * @returns player id
     */
    public function createPlayer($strNewUserName, $strPassword, $strFirstName, $strLastName, $strEmail, $strGroup = '')
    {

        $strNewUserName = addslashes($strNewUserName);	
        $strFirstName = addslashes($strFirstName);	
        $strLastName = addslashes($strLastName);	
        $strEmail = addslashes($strEmail);	

        $query = "SELECT player_id FROM players 
            WHERE user_name = '{$strNewUserName}' LIMIT 1";

        if ($obj = mysql_fetch_object(mysql_query($query))) {
            return new returnData(1, $obj->player_id, 'user exists');
        }

        $query = "INSERT INTO players (user_name, password, 
            first_name, last_name, email, created, group_name) 
            VALUES ('{$strNewUserName}', MD5('$strPassword'),
                    '{$strFirstName}','{$strLastName}','{$strEmail}', NOW(), '{$strGroup}')";

        mysql_query($query);
        if (mysql_error()) return new returnData(3, NULL, 'SQL Error');

        return new returnData(0, mysql_insert_id());
    }

    public function movePlayerToGroup($intPlayerId, $strGroup)
    {
        $query = "UPDATE players SET group_name = '{$strGroup}' WHERE player_id = '{$intPlayerId}'";
{'fraction_non_alphanumeric': 0.1413630229419703, 'fraction_numerical': 0.0033738191632928477, 'mean_word_length': 3.1937765205091937, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7635022', 'n_tokens_mistral': 894, 'n_tokens_neox': 871, 'n_words': 204}