<commit_before>MySQLMultiLineString
====================

Simple PHP code to help create a safe multi-line mysql string.

If you ever have to generate a MySQL `INSERT` statement which involves a string/text value which spans over multiple line, you probably had to involve some manual processing of the value first to ensure it doesn't break the SQL syntax. This simple tool is meant to help with that: it simply accepts a random multi-line piece of text and generates a string value which can be safely pasted into a MySQL `INSERT` or `UPDATE` statement.

Example:
--------

			<script type="text/javascript">
				function abc() {
					//do some stuff
					alert( 'done' );
				}
				abc();
			</script>


becomes:

			'<script type="text/javascript">\n'
			'\tfunction abc() {\n'
			'\t\t//do some stuff\n'
			'\t\talert( ''done'' );\n'
			'\t}\n'
			'\tabc();\n'
			'</script>\n'

The single quotes get doubled as you can see and the code adds corresponding `\n` and `\t` for new lines and tabs.<commit_msg>updated docco<commit_after>MySQLMultiLineString
====================

Simple PHP code to help create a safe multi-line mysql string.

If you ever have to generate a MySQL `INSERT` statement which involves a string/text value which spans over multiple line, you probably had to involve some manual processing of the value first to ensure it doesn't break the SQL syntax. This simple tool is meant to help with that: it simply accepts a random multi-line piece of text and generates a string value which can be safely pasted into a MySQL `INSERT` or `UPDATE` statement.

Example:
--------

			<script type="text/javascript">
				function abc() {
					//do some stuff
					alert( 'done' );
				}
				abc();
			</script>


becomes:

			'<script type="text/javascript">\n'
			'\tfunction abc() {\n'
			'\t\t//do some stuff\n'
			'\t\talert( ''done'' );\n'
			'\t}\n'
			'\tabc();\n'
			'</script>\n'

The single quotes get doubled as you can see and the code adds corresponding `\n` and `\t` for new lines and tabs.

Files
-----

The actual form and conversion is in `mysql_multiline_form.php`, and the `mysql_multiline.php` is an example on how to embed the form in your own page. The page is formatted to match my website (http://liviutudor.com) and you can actually see it in action here: http://liviutudor.com/mysql_multiline.php#sthash.u0etbzHP.Ja0k7uRl.dpbs
{'fraction_non_alphanumeric': 0.12331081081081081, 'fraction_numerical': 0.001266891891891892, 'mean_word_length': 3.387037037037037, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '5898313', 'n_tokens_mistral': 779, 'n_tokens_neox': 686, 'n_words': 316}