title: How can I save a large base64 image that is generated through summernote in my database?
body: <p>I am having a problem trying to save an image that is generated by summernote editor in my database. I am guessing that it is a character size issue. The column that I am trying to save the code of the summernote has 'Long Text' datatype. </p>
  
  <p>My code is like the following, the request established in JS, it goes to the model, and then the model calls a function that is inside the controller</p>
  
  <h2>Javascript request</h2>
  
  <pre><code>function setupSummerNote(){
      $('#summernote').summernote({
          height: 600,                 // set editor height
          minHeight: null,             // set minimum height of editor
          maxHeight: null,             // set maximum height of editor
          focus: true                  // set focus to editable area after initializing summernote
      });
      $.get("./get-section").done(function(data) {
          if(data)
          {
              $('#summernote').summernote('code', data);
          }
      });
  
      $('.note-editable').blur(function(){
          var code = $('#summernote').summernote('code');
          $.post("./update-setion", {code: code}).done(function(data) {
  
          });
      });
  }
  </code></pre>
  
  <h2>The Model</h2>
  
  <pre><code>public function updateContent()
  {
      $code = $_POST['code'];
      $modelAdmin = new Model_Admin();
      $modelAdmin-&gt;updateSection($code);
  }
  </code></pre>
  
  <h2>The Controller</h2>
  
  <pre><code>public function updateSection($code)
  {
      $this-&gt;connect();
      $query = $this-&gt;db-&gt;prepare("UPDATE `Content` SET content = ? WHERE id = ?");
      $result = $query-&gt;execute(array($code, '1')); // $code: html content of the summernote 
  }
  </code></pre>
  
  <p>how do you think I can solve this problem?</p>
  
  <p>Thanks!</p>