title: Unable to insert data to the database using a form in Symfony2
body: <p>I have a form where the user enters data. Then, when they click submit, this data will be saved to the database.</p>
  
  <p>The only thing is, it doesn't do this. What does happen, is that when submit is clicked, the page reloads and all the data entered in the form will still be displayed. I go to check the database, and the records haven't been updated.</p>
  
  <p>There are no errors, but according to the profiler there are three SQL statements run when the page is loaded. All three of these are SELECT statements, not one INSERT statement there.</p>
  
  <p>Here is the code for the page in the controller (including the "INSERT" statement):</p>
  
  <pre><code>    public function addAction(Request $request)
  {   
  
      $pageadd = new Content();
      $form = $this-&gt;createForm(new PageAdd(), $pageadd);
  
      $request = $this-&gt;getRequest();
      if ($request-&gt;getMethod() == 'POST') {
          $form-&gt;bindRequest($request);
  
          if ($form-&gt;isValid()) {
              $em = $this-&gt;getDoctrine()-&gt;getEntityManager();
  
              $em-&gt;persist($pageadd);
              $em-&gt;flush();
  
              return new Response('Created page id '.$pageadd-&gt;getId());
  
          }
      }
  
      return $this-&gt;render('ShoutAdminBundle:Default:pageadd.html.twig', array(
          'form' =&gt; $form-&gt;createView()
      ));
  
  }
  </code></pre>
  
  <p>Here is the code for the form (I've omitted some of the fields for space reasons. But they are all identical):</p>
  
  <pre><code>&lt;form action="{{ path('ShoutAdminBundle_adminpageaddpost') }}" method="post" {{ form_enctype(form) }} class="blogger"&gt;
  
      &lt;p class="row"&gt;
          {{ form_label(form.id, 'ID*', { 'attr': {'class': 'title'} }) }}
          {{ form_errors(form.id) }}
          {{ form_widget(form.id, { 'attr': {'class': 'textfield'}}) }}
      &lt;/p&gt;
      &lt;p class="row"&gt;
          {{ form_label(form.title, 'Title*', { 'attr': {'class': 'title'} }) }}
          {{ form_errors(form.title) }}
          {{ form_widget(form.title, { 'attr': {'class': 'textfield'}}) }}
      &lt;/p&gt;
  
      &lt;p class="row"&gt;
          &lt;input type="submit" value="Save This Page" class="savebutton" /&gt;
      &lt;/p&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>If you need any more code I will provide them. I think these two bits of code is where the problem lies though.</p>
  
  <p>Cheers!</p>