title: How to fix PHP Notice: unserialize(): Error at offset 1309 of 49151 bytes?
body: <p>I saved my array like this :</p>
  
  <pre><code>$saveModel = base64_encode(serialize($classifier));
  
  mysqli_query($db, "INSERT INTO model_latih(isi) VALUES('$saveModel')")or die("Error : ".mysqli_error($db)); 
  </code></pre>
  
  <p>Then  I try to take it from database with the following code :</p>
  
  <pre><code>$q = mysqli_query($db, "SELECT * FROM model_latih")or die("Error: ".mysqli_error($db));
  
  $fetch = mysqli_fetch_assoc($q);
  $row = $fetch['isi'];
  $data = unserialize(base64_decode($row));
  </code></pre>
  
  <p>But it give this error :</p>
  
  <blockquote>
    <p>PHP Notice:  unserialize(): Error at offset 1309 of 49151 bytes</p>
  </blockquote>
  
  <p>I've compared the <code>serialize</code> and <code>unserialize</code>result by length. 
  <br>Those two strings are different. The <code>serialize</code> length is 255164, <code>unserialize</code> is 65535. Seems like it doesn't fully loaded . 
  <br>Anyone know what make it different ? </p>
  
  <p>I hope someone can help me to solve this. Thank you.</p>