<commit_before><?php
# a mess
require_once "dbeng/db_abs.php";

class db_mysql extends db_abs {
	private $_conn;
	
	function __construct($host, $user, $pass, $db)
    {
		$this->_conn = mysql_connect($host, $user, $pass);
		
		if (!$this->_conn) {
			die("Unable to connect to MySQL db: " . mysql_error($this->_conn));
		} # if 
		
		
		if (!mysql_select_db($db, $this->_conn)) {
			die("Unabel to select MySQL db: " . mysql_error($this->_conn));
		} # if
		
		$this->createDatabase();
    } # ctor
		
	static function safe($s) {
		return mysql_real_escape_string($s);
	} # safe

	function rawExec($s) {
		return mysql_query($s, $this->_conn);
	} # rawExec

	function exec($s, $p = array()) {
		if (!empty($p)) {
			$p = array_map(array('db_mysql', 'safe'), $p);
		} # if
		
		if (empty($p)) {
			$res = $this->rawExec($s);
		} else {
			$res = $this->rawExec(vsprintf($s, $p));
		} # if
		if (!$res) {
			die(mysql_error());
		}
		return $res;
	} # exec
		
	function singleQuery($s, $p = array()) {<commit_msg>Warnings van mysql onderdrukken zodat de error vriendelijker is<commit_after><?php
# a mess
require_once "dbeng/db_abs.php";

class db_mysql extends db_abs {
	private $_conn;
	
	function __construct($host, $user, $pass, $db)
    {
		$this->_conn = @mysql_connect($host, $user, $pass);
		
		if (!$this->_conn) {
			die("Unable to connect to MySQL db: " . mysql_error());
		} # if 
		
		
		if (!@mysql_select_db($db, $this->_conn)) {
			die("Unabel to select MySQL db: " . mysql_error($this->_conn));
		} # if
		
		$this->createDatabase();
    } # ctor
		
	static function safe($s) {
		return mysql_real_escape_string($s);
	} # safe

	function rawExec($s) {
		return mysql_query($s, $this->_conn);
	} # rawExec

	function exec($s, $p = array()) {
		if (!empty($p)) {
			$p = array_map(array('db_mysql', 'safe'), $p);
		} # if
		
		if (empty($p)) {
			$res = $this->rawExec($s);
		} else {
			$res = $this->rawExec(vsprintf($s, $p));
		} # if
		if (!$res) {
			die(mysql_error());
		}
		return $res;
	} # exec
		
	function singleQuery($s, $p = array()) {
{'fraction_non_alphanumeric': 0.19544131910766246, 'fraction_numerical': 0.0, 'mean_word_length': 3.3893617021276596, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 20, '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': '1955067', 'n_tokens_mistral': 875, 'n_tokens_neox': 780, 'n_words': 176}