title: Update query PHP MySQL
body: <p>Can anybody help me understand why this update query isn't updating the fields in my database? I have this in my php page to retrieve the current values from the database:</p>
  
  <pre><code>&lt;?php
  
    $query = mysql_query ("SELECT * FROM blogEntry WHERE username = 'bobjones' ORDER BY id DESC");
  
    while ($row = mysql_fetch_array ($query)) 
    {
        $id = $row['id']; 
        $username = $row['username'];
        $title = $row['title'];
        $date = $row['date'];
        $category = $row['category'];
        $content = $row['content'];
  
  
      ?&gt;
  </code></pre>
  
  <p>Here i my HTML Form:</p>
  
  <pre><code>&lt;form method="post" action="editblogscript.php"&gt;
  ID: &lt;input type="text" name="id" value="&lt;?php echo $id; ?&gt;" /&gt;&lt;br /&gt;
  Username: &lt;input type="text" name="username" value="&lt;?php echo $_SESSION['username']; ?&gt;" /&gt;&lt;br /&gt;
  Title: &lt;input type="text" name="udtitle" value="&lt;?php echo $title; ?&gt;"/&gt;&lt;br /&gt;
  Date: &lt;input type="text" name="date" value="&lt;?php echo $date; ?&gt;"/&gt;&lt;br /&gt;
  Message: &lt;textarea name = "udcontent" cols="45" rows="5"&gt;&lt;?php echo $content; ?&gt;&lt;/textarea&gt;&lt;br /&gt;
  &lt;input type= "submit" name = "edit" value="Edit!"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>and here is my 'editblogscript':</p>
  
  <pre><code>&lt;?php
  
  mysql_connect ("localhost", "root", "");
  mysql_select_db("blogass");
  
  if (isset($_POST['edit'])) {
  
      $id = $_POST['id'];
      $udtitle = $_POST['udtitle'];
      $udcontent = $_POST['udcontent'];
  
  
      mysql_query("UPDATE blogEntry SET content = $udcontent, title = $udtitle WHERE id = $id");
  }
  
  header( 'Location: index.php' ) ;
  
  
  
  
  
  ?&gt;
  </code></pre>
  
  <p>I don't understand why it doesn't work.</p>