<commit_before><?php
    class db_insert {
        //Objects of this class type require an object to be used of the class type db_connect for composition purposes.
        //main Class variable members

        public $inserting;
        public $tablename;
        public $dbValues;
        public $query;

        //There is no constructor function, instead users should decide to have a query generated for them or to use the query function to input their own
        public function gen_query($valuesToInsert, $DataBaseValues, $tablename){
            //Generate the query to the database with the simple inputted information
            $this->inserting = $valuesToInsert;
            $this->dbValues = $DataBaseValues;
            $this->tablename = $tablename;
            //Create the queryresult Variable
            $queryResult = "INSERT INTO {$this->tablename} ({$this->dbValues}) VALUES ({$this->inserting});";
            //return the result as a handle for the function - function can be used as a handle and re-used to develop more queries
            return $queryResult;
        }

        public function insert_query($insertedQuery, $handleorNot){
            //Escaoe the string to prevent any SQL injection or security issues
            $this->query = mysqli_real_escape_string($insertedQuery);
            //test for handle use
            if($handleorNot == TRUE){
                //return the query as the function handle (RECOMMENDED)
                return $this->query;
            }elseif($handleorNot == FALSE){
                //Echo out the query (NOT-RECOMMENDED)
                echo "The Query you generated, after escaped, was : {$this->query}";
            }else{
                //there is a problem and an error message will be returned as the handle instead
                $errorMsg = "You cannot set a non-bool as the handle conditional, please re-create this query";
                //Return Message
                return $errorMsg;
            }
        }

    }

    echo "<h1>No Errors Mate!</h1>";

?><commit_msg>Update insert.php<commit_after><?php
    class db_insert {
        //Objects of this class type require an object to be used of the class type db_connect for composition purposes.
        //main Class variable members

        public $inserting;
        public $tablename;
        public $dbValues;
        public $query;

        //There is no constructor function, instead users should decide to have a query generated for them or to use the query function to input their own
        public function gen_query($valuesToInsert, $DataBaseValues, $tablename){
            //Generate the query to the database with the simple inputted information
            $this->inserting = $valuesToInsert;
            $this->dbValues = $DataBaseValues;
            $this->tablename = $tablename;
            //Create the queryresult Variable
            $queryResult = "INSERT INTO {$this->tablename} ({$this->dbValues}) VALUES ({$this->inserting});";
            //return the result as a handle for the function - function can be used as a handle and re-used to develop more queries
            return $queryResult;
        }

        public function insert_query($insertedQuery, $handleorNot){
            //Escaoe the string to prevent any SQL injection or security issues
            $this->query = mysqli_real_escape_string($insertedQuery);
            //test for handle use
            if($handleorNot == TRUE){
                //return the query as the function handle (RECOMMENDED)
                return $this->query;
            }elseif($handleorNot == FALSE){
                //Echo out the query (NOT-RECOMMENDED)
                echo "The Query you generated, after escaped, was : {$this->query}";
            }else{
                //there is a problem and an error message will be returned as the handle instead
                $errorMsg = "You cannot set a non-bool as the handle conditional, please re-create this query";
                //Return Message
                return $errorMsg;
            }
        }

    }
?>
{'fraction_non_alphanumeric': 0.08074382187423539, 'fraction_numerical': 0.0004893564962074871, 'mean_word_length': 2.0553064275037367, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 25, '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': '1966540', 'n_tokens_mistral': 1007, 'n_tokens_neox': 972, 'n_words': 407}