title: Can not Insert record into mysql table with php prepared-statement
body: <p>my code partially works in <strong><code>ELSE</code></strong> part below. What I mean partially is <strong>it doesn't INSERT INTO table</strong> but since all verification stages are correct, <strong>it redirects to thanks page.</strong><br /><br />What I normally expect is both. Insert into table <strong>A N D</strong> then go to thanks page.<br /><br />I thought my situation is about the prepared statement so I studied <a href="http://php.net/manual/en/mysqli.quickstart.prepared-statements.php" rel="nofollow">http://php.net/manual/en/mysqli.quickstart.prepared-statements.php</a> but I couldn't solve my case. I am getting <strong>NO</strong> notice, warning or error. but my table is still empty. Can you help with my fault(s) please?<br /><br />Thanks<br /><br />BR</p>
  
  <pre><code>    header( "HTTP/1.1 303 See Other" );
  
  if ($_SESSION['hatalar'] != '')
  {
      $sonraki_sayfa = sitenin_koku.'yazılar/'.$_SESSION['spesifik_yazi_url'];
      header('Location: ' . $sonraki_sayfa);
  }
  else //verification passed. save the comment + redirect to thanks page.
  {
      /* YORUMU TABLOYA YAZDIRALIM  */
      $sorgum = "INSERT INTO tb_yorumlar (kolon_yorumcu_isim, kolon_statu, kolon_yorum, kolon_hangi_yazara, kolon_hangi_basliga, kolon_yorum_tarihi, kolon_ip) VALUES (?, ?, ?, ?, ?, NOW(), ?)";
  
      if ($beyan = $db_baglanti-&gt;prepare($sorgum)) 
          {
              /* give their values to parameters  */ 
              $bindparametre1 = $_POST['yf-isim'];
              $bindparametre2 = 'onay';
              $bindparametre3 = $_POST['yf-mesaj'];
              $bindparametre4 = $_SESSION['spesifik_yazi_yazar'];
              $bindparametre5 = $_SESSION['spesifik_yazi_baslik'];
              $bindparametre6 = $_SERVER['REMOTE_ADDR'];
  
              /* bind parameters */
              if (!$beyan -&gt; bind_param("ssssss", $bindparametre1, $bindparametre2, $bindparametre3, $bindparametre4, $bindparametre5, $bindparametre6))
              {echo "parametre atama hatası: (" . $beyan-&gt;errno . ") " . $beyan-&gt;error;}
  
              /* execute statement */
              if (!$beyan-&gt;execute())
              {echo "Gerçekleştirme hatası: (" . $beyan-&gt;errno . ") " . $beyan-&gt;error ;}
          }
      else {echo "Hazırlama hatası: (" . $db_baglanti-&gt;errno . ") " . $db_baglanti-&gt;error;}
  
      /* TEŞEKKÜR SAYFASINA YÖNLENDİRELİM */
      $sonraki_sayfa = sitenin_koku.'yorumunuz-için-teşekkür-ederim';
      header('Location: ' . $sonraki_sayfa);
  
  }
  </code></pre>