title: Update Database Not Working
body: <p>Can anyone tell me why this isn't working? Everything comes up fine but when I hit submit it doesn't update the database.</p>
  
  <pre><code>$row = mysql_fetch_array($sql);
  $title = $row['title'];
  $content = $row['content'];
  $author = $row['author'];
  $author_email = $row['author_email'];
  $cat = $row['category'];
  $date = $row['date'];
  $id = $row['id'];
  
  
  $form = "&lt;tr&gt;&lt;td&gt;$id
      &lt;form action='edit.php' method='post'&gt;
      &lt;input type='text' value='$title' name='title'&gt;&lt;br&gt;
      &lt;textarea name='content'&gt;$content&lt;/textarea&gt;&lt;br&gt;
      &lt;input type='submit' name='submit'&gt;
          &lt;/td&gt;&lt;/tr&gt;";
  
  $ptitle = htmlentities($_POST['title']);
  $pcontent = htmlentities($_POST['content']);
  
  if($_POST['submit']){
      if ($ptitle &amp;&amp; $pcontent){
          mysql_query("UPDATE blogdata SET id='$id', title='$ptitle', author='$author', author_email='$author_email', date='$date', category='$category', content='$pcontent' WHERE id='$id'");
      }
      else
          echo "A forms empty.";
  }
  else
      echo "$form";
  </code></pre>