title: How to insert large text into a DB with PHP?
body: <p>I have a function that generates a random text with about 8,000 characters.</p>
  
  <p>This text is generated at the time of first access the page, based on some parameters.</p>
  
  <p>I would like this text to be storing in the database (not to be necessary to generate another text to each access).</p>
  
  <p>I successfully stored in the database all the variables except the large text. Also could store when the text is small:</p>
  
  <pre><code>$LargeText=Texto(); //-&gt; about 8,000 characters
  
  if(empty($Descricao)){
  $InserirDescricao = strtoupper($Nome);
  mysql_query("UPDATE lavanderias SET descricao = \"$InserirDescricao\" WHERE id=$CidadeID");} //-&gt; This works fine
  
  if(empty($Texto)){
  mysql_query("UPDATE lavanderias SET texto = \"$LargeText\" WHERE id=$CidadeID");} //-&gt; This not works :(
  
  if(empty($Texto)){
  mysql_query("UPDATE lavanderias SET texto = \"ANYTHING\" WHERE id=$CidadeID");} //-&gt; This works fine
  </code></pre>
  
  <p>The third message generates this error message:</p>
  
  <pre><code>Fatal error: Uncaught exception 'mysqli_sql_exception' with message 
  'You have an error in your SQL syntax; check the manual that corresponds
  to your MySQL server version for the right syntax to use near 
  'servico"&gt;&lt;div class="servico-ilustracao servico-ilustracao-5"&gt;&lt;h2&gt;Lavagem de Pro' 
  at line 1' 
  </code></pre>
  
  <p>It is possible that the number of characters is preventing the insertion? How do I manage to insert the variable with the large text?</p>