title: SQLSTATE[HY093]: Invalid parameter number: no parameters were bound
body: <p>I'm getting the error "SQLSTATE[HY093]: Invalid parameter number" when I try to run the below function:</p>
  
  <pre><code>public function showAction(Post $post, Request $request){
  
      $comment = new Comment();
      $comment-&gt;setPost($post);
  
      //comment-&gt;setUser($user);
  
      $form  = $this-&gt;createForm(CommentType::class, $comment); /*obiekt formularza */
      $form-&gt;handleRequest($request);
  
  
      if($form-&gt;isValid()){
          $em = $this-&gt;getDoctrine()-&gt;getManager();
          $em-&gt;persist($comment);
          $em-&gt;flush('success', 'Komentarz został pomyślnie dodany');
  
          $this-&gt;addFlash();
  
          return $this-&gt;redirectToRoute('post_show', array('id' =&gt;$post-&gt;getId()));
      }
  
  
      return $this-&gt;render('default/show.html.twig', array(
          'post' =&gt; $post,
          'form' =&gt; $form-&gt;createView()
      ));
  }
  </code></pre>
  
  <p>My CommentTye form:</p>
  
  <pre><code>class CommentType extends AbstractType
  {
  /**
   * @param FormBuilderInterface $builder
   * @param array $options
   */
  public function buildForm(FormBuilderInterface $builder, array $options)
  {
      $builder
          -&gt;add('content', \Symfony\Component\Form\Extension\Core\Type\TextareaType::class, array(
              'label' =&gt; false,
              'attr' =&gt; array('placeholder' =&gt; 'Treść komentarza')
          ))
          -&gt;add('createdAt')
          -&gt;add('post')
          -&gt;add('user')
          ;
  }
  
  /**
   * @param OptionsResolverInterface $resolver
   */
  public function configureOptions(OptionsResolver $resolver)
  {
      $resolver-&gt;setDefaults(array(
          'data_class' =&gt; 'AppBundle\Entity\Comment'
      ));
  }
  
  /**
   * @return string
   */
  public function getName()
  {
      return 'appbundle_comment';
  }
  }
  </code></pre>
  
  <p>When I run it, I get</p>
  
  <pre><code>Message: An exception occurred while executing 'INSERT INTO comment (content, created_at, post_id, user_id) VALUES (?, ?, ?, ?)':
  </code></pre>
  
  <p>SQLSTATE[HY093]: Invalid parameter number: no parameters were bound </p>
  
  <p>Please help me fix this</p>