PHP 7, mySQL, phpMyAdmin, localhost, MAMP, Mac
$Definition = verb (used without object) , abode or abided, abiding. 1. to remain; continue; stay: abide with me. 2. to have one's abode; dwell; reside: to abide in a small scottish village. 3. to continue in a particular condition, attitude, relationship, etc.; last. verb (used with object) , abode or abided, abiding. 4. to put up with; tolerate; stand: i can't abide dishonesty! 5. to endure, sustain, or withstand without yielding or submitting: to abide a vigorous onslaught. 6. to wait for; await: to abide the coming of the lord. 7. to accept without opposition or question: to abide the verdict of the judges. 8. to pay the price or penalty of; suffer for. verb phrases 9. abide by, to act in accord with. to submit to; agree to: to abide by the court's decision. to remain steadfast or faithful to; keep: if you make a promise, abide by it.;
$Definition = implode('', $InterArray); //I also tested the array to string conversion works fine
//$Definition = 'Test test test'; I tested this and it worked
$Definition = (string) $Definition;
$conn = mysqli_connect("localhost:8889","root","root","myDB");
$sql="INSERT INTO myTable (DEFINITION) VALUES('".$Definition."');";
to avoid any confusion, it's preferable to use
mysqli_real_escape_string() than to escape the string manually.
mysqli_real_escape_string() function takes care of the escaping itself.
according to php.net:
"This function is used to create a legal SQL string that you can use in an SQL statement. The given string is encoded to an escaped SQL string, taking into account the current character set of the connection."
as Magnus said, Prepared Statement is always the best choice. you can never be too sure about the security of your aplication.