<commit_before><?php

	//create_db.php - Script to create new MySQL database

	include "cred_ext.php";

	//Create connection
	$con = mysqli_connect(DB_HOST, DB_USERNAME, DB_PASSWORD);
	// Check connection
	if (mysqli_connect_errno()) {
		echo "Failed to connect to MySQL: " . mysqli_connect_error();
	}


	// Create database
	$sql = "CREATE DATABASE test_db";
	if (mysqli_query($con, $sql)) {
		echo "Database test_db created successfully.\n";
	}
	else {
	 	echo "Error creating database: " . mysqli_error($con);
	}



	// Close connection
	mysqli_close($con);

?><commit_msg>Refactored create_db for PDO db interaction<commit_after><?php

    //create_db.php - Script to create new MySQL database

    include "cred_ext.php";

   try {
   	//Create connection
	$dbh = new PDO('mysql:host=localhost', DB_USERNAME, DB_PASSWORD);

	// Create database
	$stmt = $dbh->prepare('CREATE DATABASE test_db');
        $stmt->execute();

	echo "Database test_db created successfully.\n";

        $stmt->closeCursor();
        $stmt = null;
        $dbh = null;
    }
    catch (PDOException $e) {
        print "Error: " . $e->getMessage() . "<br/>";
        die();
    }

?>
{'fraction_non_alphanumeric': 0.14163090128755365, 'fraction_numerical': 0.0, 'mean_word_length': 3.164285714285714, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 10, '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': '4976903', 'n_tokens_mistral': 412, 'n_tokens_neox': 388, 'n_words': 98}