<commit_before><commit_msg>Adding school function <commit_after><?php

// Turn off all error reporting
error_reporting ( 0 );

require 'secure/config.php';

// Create connection
$connection = mysqli_connect ( DB_HOST, DB_USER, DB_PASS, DB_NAME );

$response = array ();

// Check connection
if (mysqli_connect_errno ( $connection )) {
	$response [Status] = "Error";
	$response [Message] = "Failed to connect to MySQL: " . mysqli_connect_error ();
} else {

	// read the post data
	$inputJSON = file_get_contents ( 'php://input' );

	// load json data
	$input = json_decode ( $inputJSON, TRUE );

	// Adding users to the db
	$query = "INSERT INTO schools (name, city, state, country) VALUES ('" . $input [name] . "','" . $input [city] . "','" . $input [state] . "', '" . $input [country] . "')";

	mysqli_query ( $connection, $query );
	// end of adding users

	$response [Status] = "OK";

	mysqli_close ( $connection );
}

echo json_encode ( $response );

?>
{'fraction_non_alphanumeric': 0.16805845511482254, 'fraction_numerical': 0.0010438413361169101, 'mean_word_length': 3.8680203045685277, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '94097', 'n_tokens_mistral': 328, 'n_tokens_neox': 313, 'n_words': 91}