title: How to save updated CKEditor content to database?
body: <p>I've searched high and low both on Google and this site for an answer to this question with no luck.</p>
  
  <p>I'm working on a custom CMS for future customers who want to do their own maintenance. Here's the code that loads the current page content into the textarea from the database:</p>
  
  <pre><code>if(isset($_GET['id'])) {
      $id = $_GET['id'];
      $content = mysql_query("SELECT title, content FROM pages WHERE id=".$id);
      $search = mysql_num_rows($content);
      if($search &gt; 0){
          while($page = mysql_fetch_array($content)) { ?&gt;
          &lt;h1&gt;Editing &lt;?php echo $page['title']; ?&gt;&lt;/h1&gt;
      &lt;form id="editform" action="save.php?id=&lt;?php echo $_GET['id']; ?&gt;" method="post"&gt;
      &lt;textarea id="editor" name="content"&gt;&lt;?php echo $page['content']; ?&gt;&lt;/textarea&gt;
      &lt;/form&gt;
  &lt;?php } 
      }
  } ?&gt;
  </code></pre>
  
  <p>Here's the code in <code>save.php</code>:</p>
  
  <pre><code>&lt;?php
  if(isset($_POST['content'])){
  $content = $_POST['content'];
  $id = $_GET['id'];
  
  echo $content;
  
  mysql_query("UPDATE pages SET content=".$content." WHERE id=".$id);
  }
  ?&gt;
  </code></pre>
  
  <p>The problem is that the POST['content'] keeps getting the original content, not the edited one that the user just submitted.</p>
  
  <p>How do I fix this?</p>