title: PHP Array ( [id] => 0 )
body: <p>I am trying to write a program for my test lab with windows 2012 + MySQL + IIS + PHP, my program read the database, but when I am trying to write the data to the database, it shows "Array ( [id] => 0 )", that means my program does not writing data to the database, what is the problem ? I am a beginer writing program, please help me ? My code is as under : </p>
  
  <pre><code>&lt;?php
  
  session_start();
  
  error_reporting(E_ALL &amp; ~E_NOTICE);
  
  // Connect to Database
  
  $link = mysqli_connect("localhost", "root", "password", "admin");
  
  // Connection Status
  
  if ($link-&gt;connect_error) {
  
      die ("Connection Failed : " . $link-&gt;connect_error);
  }
  
  if ($_POST['submit']) {
  
      if (!$_POST['email'])
          $error .= "&lt;br /&gt;Bitte trage deine Email Addresse ein !";
  
      else if (!filter_var($_POST['email'], FILTER_VALIDATE_EMAIL))
          $error .= "&lt;br /&gt;Bitte eine korrekte email Address ein !";
  
      if (!$_POST['password'])
          $error .= "&lt;br /&gt;Bitte trage dein Passwort ein !";
  
      else {
          if (strlen($_POST['password']) &lt; 8)
              $error .= "&lt;br /&gt;Bitte trage ein längeres Password ein !";
  
          if (!preg_match('`[A-Z]`', $_POST['password']))
              $error .= "&lt;br /&gt;Bitte nutze ein Großbuchstaben password ein !";
  
      }
  
      if (isset($error))
          echo "Es gab fehler in deinem Login Details : " . $error;
  
      else {
  
          $query = "SELECT * FROM `benutzer` WHERE email ='" . mysqli_real_escape_string($link, $_POST['email']) . "'";
  
          $result = mysqli_query($link, $query);
  
          $results = mysqli_num_rows($result);
  
          if ($results) echo "Die eMailaddresse ist bereits vergeben. &lt;br /&gt;Möchtest do dich einloggen ?";
  
              $query = "INSERT INTO benutzer (email, password) VALUES ('" . mysqli_real_escape_string($link, $_POST['email']) . "', '" . md5(md5($_POST['email']) . $_POST['password']) . "')";
  
              mysqli_query($link, $query);
  
              echo "&lt;br /&gt;Du hast dich erfolgreich registriert ! ";
  
              $_SESSION['id'] = mysqli_insert_id($link);
  
              print_r($_SESSION); 
  
  
      }
  
  }
  
  ?&gt;
  
  
  
  &lt;form method="post"&gt;
  
      &lt;input type="email" name="email" id="email" id="email" /&gt;
      &lt;input type="password" name="password" /&gt;
      &lt;input type="submit" name="submit" value="Einlogen" /&gt;
  
  &lt;/form&gt;
  </code></pre>