<commit_before><?php

	// select.php Script to execute from index.php to view the contents of test_db.Apprentices

	include "cred_int.php";

	try {
		//Create connection
		 $con = new PDO(DSN, DB_USERNAME, DB_PASSWORD);
		//$con = new PDO('mysql:host=localhost;dbname=test_db', root, root);
		//echo $con;
		// $con = mysqli_connect(DB_HOST, DB_USERNAME, DB_PASSWORD, DB_DATABASE);

		$tableName = "Apprentices";

		$query = $con->prepare("SELECT * FROM :tableName");
		$query->bindParam(':tableName', $tableName);

		echo $query;
		
		echo "<table border='1'>
		<tr>
		<th>First Name</th>
		<th>Middle Name</th>
		<th>Last Name</th>
		<th>Birth Day</th>
		<th>Birth Month</th>
		<th>Birth Year</th>
		<th>Gender</th>
		<th>18 or Older</th>
		</tr>";

		$query->execute();

		foreach($con->$query as $row) {
			echo "<tr>";			
			echo "<td>" . $row['FirstName'] . "</td>";
			echo "<td>" . $row['MiddleName'] . "</td>";
			echo "<td>" . $row['LastName'] . "</td>";
			echo "<td>" . $row['DayBirth'] . "</td>";
			echo "<td>" . $row['MonthBirth'] . "</td>";
			echo "<td>" . $row['YearBirth'] . "</td>";
			echo "<td>" . $row['Gender'] . "</td>";
			echo "<td>" . $row['AgeCheck'] . "</td>";
			echo "</tr>";
		}

		echo "</table>";

		$query->closeCursor();
		$query = null;
		$con = null;
	}

	catch (PDOException $e) {
		print "Error!: " . $e->getMessage() . "<br/>";
		die();
	}<commit_msg>Refactored select.php for PDO<commit_after><?php

	// select.php Script to execute from index.php to view the contents of test_db.Apprentices

	include "cred_int.php";

	try {
		//Create connection
         	$dbh = new PDO(DSN, DB_USERNAME, DB_PASSWORD);
		
		$stmt = $dbh->prepare("SELECT * FROM Apprentices");
		
		echo "<table border='1'>
		<tr>
		<th>First Name</th>
		<th>Middle Name</th>
		<th>Last Name</th>
		<th>Birth Day</th>
		<th>Birth Month</th>
		<th>Birth Year</th>
		<th>Gender</th>
		<th>18 or Older</th>
		</tr>";

		$stmt->execute();

		$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);

		foreach($rows as $row) {
			echo "<tr>";			
			echo "<td>" . $row['FirstName'] . "</td>";
			echo "<td>" . $row['MiddleName'] . "</td>";
			echo "<td>" . $row['LastName'] . "</td>";
			echo "<td>" . $row['DayBirth'] . "</td>";
			echo "<td>" . $row['MonthBirth'] . "</td>";
			echo "<td>" . $row['YearBirth'] . "</td>";
			echo "<td>" . $row['Gender'] . "</td>";
			echo "<td>" . $row['AgeCheck'] . "</td>";
			echo "</tr>";
		}

		echo "</table>";

		$stmt->closeCursor();
		$stmt = null;
		$dbh = null;
	}

	catch (PDOException $e) {
		print "Error!: " . $e->getMessage() . "<br/>";
		die();
	}
{'fraction_non_alphanumeric': 0.24855268236202238, 'fraction_numerical': 0.0023157082207641835, 'mean_word_length': 3.1339712918660285, 'pattern_counts': {'":': 0, '<': 83, '<?xml version=': 0, '>': 92, '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': '3332782', 'n_tokens_mistral': 1141, 'n_tokens_neox': 1003, 'n_words': 229}