title: Save JSON string (from canvas) in MySQL table
body: <p>I want to save a json string in MySQL table. The json string comes from a canvas (using fabricjs). </p>
  
  <pre><code>var jsonCanvas = JSON.stringify(canvas.toDatalessObject());
  </code></pre>
  
  <p>My first question is, what is the best datatype for saving the json string in MySQL? The Canvas will contain images as well as text and other objects. 
  Do you think MEDIUMTEXT is enough? </p>
  
  <p>The other question.
  Is it possible to save the json string with this prepared statement. I'm doubtful to use the keyword "s" for string.</p>
  
  <pre><code>try {
    $sql = "insert into layout (lt_author, lt_date, lt_category, lt_json_string)
     values (?,?,?,?)";
    $stmt = $mysqli-&gt;prepare($sql);
    $stmt-&gt;bind_param("ssss",$lt_author, $lt_date, $lt_category, $lt_json_string);
    $stmt-&gt;execute();
    $stmt-&gt;close();
  </code></pre>
  
  <p>Thank you for helping :)
  Greetings Max</p>