title: How can I add more than 3 rows to my json output?
body: <p>I'm trying to write a website where productinfo from a database gets shown and filtered.
  But I'm running into a problem with my json output:
  I'm trying to put my data into an array where i can grab my data from later on my html.
  But I cant get more than 3 rows into my array, if I try to add more I get the error
  'Uncaught SyntaxError: JSON.parse: bad control character in string literal at line 1 column 550 of the JSON data'.
  How can I add at least one more?</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>&lt;script&gt;
                     var xmlhttp = new XMLHttpRequest();
                  var url = "getInstruments.php";
                  xmlhttp.onreadystatechange=function() {
                    if (this.readyState == 4 &amp;&amp; this.status == 200) {
                      myFunction(this.responseText);
                    }
                  }
                  
                  xmlhttp.open("GET", url, true);
                  xmlhttp.send();
                  
                  function myFunction(response) {
                    var arr = JSON.parse(response);
                    var i;
                    var j = '&lt;div class="row" style="display:grid;"&gt;';
                    var k = '&lt;div class="tile"&gt;'; 
                    var l = '&lt;div class="card-deck"&gt;';
                    var m = '&lt;div class="card border-secondary"&gt;';
                    var n = '&lt;img style="height:300;" src="images/" class="card-img-top"&gt;';
                    var o = '&lt;div class="card-title"&gt;';
                    var p = '&lt;h6 class="text-light bg-info text-center rounded p-1"&gt;';
                    var q = '&lt;div class="card-body"&gt;';
                    var r = '&lt;h4 class="card-title text-danger"&gt;';
                    var s = '&lt;div class="hovertext"&gt;';   
                  
                    
                    var out = j; 
                    for(i = 0; i &lt; arr.length; i++) {
                      out += k;
                      
                      out += l;
                      out += m;
                      out += n;
                      out += o;
                      out += p;
                      out += arr[i].Name;
                      out += "&lt;/h6&gt;";
                      out += q;
                      out += "&lt;h5&gt;";
                      out += "Artikelnr.: "
                      out += arr[i].Artikelnr;     
                      out += "&lt;/h5&gt;"
                      out += r;
                      out += "Preis ";
                      out += arr[i].Preis;
                      out += " Euro";
                      out += "&lt;/h4&gt;"
                      out += s;
                      out += "&lt;/div&gt;";
                      out += "&lt;/div&gt;";
                      out += "&lt;/div&gt;";
                      out += "&lt;/div&gt;";
                      out += "&lt;/div&gt;";
                      out += "&lt;/div&gt;";
                    }
                    out += "&lt;/div&gt;";
                    document.getElementById("id01").innerHTML = out;
                  }
                  &lt;/script&gt;</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;?php
  header("Access-Control-Allow-Origin: *");
  header("Content-Type: application/json; charset=UTF-8");
  
  $conn = new mysqli("localhost","root","","musik");
  if($conn-&gt;connect_error) {
    exit('Could not connect');
  }
  
  
  
  $result = $conn-&gt;query("SELECT ARTIKELNR, ART, BEZ, PREIS, BEM, BILDPFAD FROM INSTRUMENT ");
  $outp = "[";
  while($rs = $result-&gt;fetch_array(MYSQLI_ASSOC)) {
      if ($outp != "[") {$outp .= ",";}
      $outp .= '{"Name":"'  . $rs["BEZ"] . '",';
      $outp .= '"Artikelnr":"'   . $rs["ARTIKELNR"] . '",';
      //$outp .= '"Art":"'  .$rs["ART"] .'",'; -&gt;IF I ADD IT, I GET THE ERROR
      $outp .= '"Preis":"'. $rs["PREIS"]     . '"}';
  }
  $outp .="]";
  
  $conn-&gt;close();
  
  
  echo ($outp);
  
  ?&gt;</code></pre>
  </div>
  </div>
  </p>