title: Register form not posted details in a database table
body: <p>I am trying to make register form. In my every php code is working file in register form but one problem. When I click submit button it is not registered, only says - "error not posted database users table from details".</p>
  
  <p>I have 3 options in registration system. First function for <strong>register.php</strong> i think my problem is here.</p>
  
  <pre><code>&lt;?php  
  include '../core/init.php';
  if (empty($_POST) === false &amp;&amp; empty($errors) === true ) {
  
  $register_data = array(
     'name'    =&gt; $_POST['name'],
     'surname'    =&gt; $_POST['surname'],
     'email'    =&gt; $_POST['email'],
     're_email'    =&gt; $_POST['re_email'],
     'password'    =&gt; $_POST['password'],
     'day'    =&gt; $_POST['day'],
     'year'    =&gt; $_POST['year'],
     'month'    =&gt; $_POST['month'],
     'birthday'    =&gt; $_POST['year'] . '-' . $_POST['month'] . '-' . $_POST['day'],
     'kadin_erkek'    =&gt; $_POST['optionsRadios']
  );
  
  register_user($register_data);
  }
  if(empty($_POST) === false) {
      $required_fields = array('name','surname','email','re_email','password','birthday','kadin_erkek');
      foreach($_POST as $key=&gt;$value) {
          if(empty($value) &amp;&amp; in_array($key, $required_fields) === true) {
               echo"&lt;div class='error_name'&gt;Doldurmanız gereken alanları boş bıraktınız!&lt;/div&gt;";
             exit();
               break 1;
              }
          }
          if (empty($errors) === true) {
              if(user_exists($_POST['email']) === true) {
                  echo"&lt;div class='error_name'&gt; Üzgünüz bu email adresi kullanımda&lt;/div&gt;";
  
                  }
                  if($_POST['email'] !== $_POST['re_email']) {
                      echo"&lt;div class='error_name'&gt; Email adresleri eşleşmiyor&lt;/div&gt;";
  
                      } 
                  if(filter_var($_POST['email'], FILTER_VALIDATE_EMAIL) === false) {
                      echo"&lt;div class='error_name'&gt;Lütfen geçerli bir email adresi giriniz!&lt;/div&gt;";
  
                      }
                  if(strlen($_POST['password']) &lt; 6) {
  
                      echo"&lt;div class='error_name'&gt;Parolanız en az 6 karakter olabilir&lt;/div&gt;";
                      }
  
              }
  
      }
  
  ?&gt;
  </code></pre>
  
  <p>second time is <strong>users.php</strong> function </p>
  
  <pre><code>function register_user($register_data) {
      array_walk($register_data, 'array_sanitize');
      $register_data['password'] = md5($register_data['password']);
      $fields = '`' . implode('`,`', array_keys($register_data)) . '`';
      $data = '\'' . implode('\', \'', $register_data) . '\'';
      mysql_query("INSERT INTO `users` ($fields) VALUES ($data)");
      }
  </code></pre>
  
  <p>and the last one is <strong>general.php</strong> </p>
  
  <pre><code>&lt;?php 
  function array_sanitize(&amp;$item) {
      $item =  mysql_real_escape_string($item);
      }
  function sanitize($data) {
      return mysql_real_escape_string($data);
  }
  
  ?&gt;
  </code></pre>