<commit_before><?php

/* access data in config file (data not inside repo) */
include_once( 'dbconf.php' );

mysql_connect( $dbhost, $dbuser, $dbpass ) or
	die( 'Keine Verbindung möglich: ' . mysql_error() );
mysql_select_db( $dbname );

$result = mysql_query( 'SELECT bu.id AS id, barcode, titel, au.name AS autor FROM buecher AS bu JOIN autor AS au ON au.id = bu.autorid' );

if( $result === FALSE ) { 
	die( mysql_error() ); // TODO: better error handling
}

echo '<table border="1">';
while ( $row = mysql_fetch_array( $result ) ) {
	echo '<tr>';
	echo '<td>' . $row['barcode'] . '</td>';
	echo '<td><h2><a href="details.php?id=' . $row['id'] . '">' . $row['titel'] . '</a></h2></td>';
	echo '<td>' . $row['autor'] . '</td>';
	echo '</tr>';
}
echo '</table>';  

mysql_free_result( $result );

?><commit_msg>encode strings to proper utf8, use fucntion syntax, close handles that are opened<commit_after><?php

echo( '<!doctype html><html><head><title>Bookshop - Übersicht</title><meta charset="UTF-8"></head><body>' );

/* access data in config file (data not inside repo) */
include_once( 'dbconf.php' );

$dblink = mysql_connect( $dbhost, $dbuser, $dbpass ) or
	die( 'Keine Verbindung möglich: ' . mysql_error() );
mysql_select_db( $dbname );

$result = mysql_query( 'SELECT bu.id AS id, barcode, titel, au.name AS autor FROM buecher AS bu JOIN autor AS au ON au.id = bu.autorid' );

if( $result === FALSE ) {
	die( mysql_error() ); // TODO: better error handling
}

echo( '<table border="1">' );
while ( $row = mysql_fetch_array( $result ) ) {
	echo( '<tr>'
	. '<td>' . utf8_encode( $row['barcode'] ) . '</td>'
	. '<td><h2><a href="details.php?id=' . utf8_encode( $row['id'] ) . '">' . utf8_encode( $row['titel'] ) . '</a></h2></td>'
	. '<td>' . utf8_encode( $row['autor'] ) . '</td>'
	. '</tr>' );
}
echo( '</table>' );

mysql_free_result( $result );

mysql_close( $dblink );

echo('</body></html>');

?>
{'fraction_non_alphanumeric': 0.22489539748953974, 'fraction_numerical': 0.006276150627615063, 'mean_word_length': 4.212534059945504, 'pattern_counts': {'":': 0, '<': 43, '<?xml version=': 0, '>': 43, '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': '7206439', 'n_tokens_mistral': 716, 'n_tokens_neox': 716, 'n_words': 189}