title: Incorrect integer value: '' for column 'id' at row 1 (Help needed )
body: <p>I have an error on my register page. I'm trying to resolve this now for 2 hours, but it still isn't fixed.</p>
  
  <p>My php code:</p>
  
  <pre><code>&lt;?php
  define('SSL', true);
  $page['dir'] = '\quickregister';
  require_once('../includes/core.php');
  require_once('./includes/recaptchalib.php');
  if(isset($_SESSION['user'])){
      header("Location: ".PATH."/me");
      exit;
  }
  
  ini_set("display_errors", 1);
  
  
  $data = new register_sql;
  $captchaResponse = $input-&gt;FilterText($_POST['captchaResponse']);
  $privatekey = "THIS IS AN ULTRA SECRET KEY I SHOULD NOT SHARE, I SHOULD TREAT IS AS A PASSWORD";
  $resp = recaptcha_check_answer ($privatekey,
                                  $_SERVER["REMOTE_ADDR"],
                                  $_POST["recaptcha_challenge_field"],
                                  $captchaResponse);
  
  if(!$resp-&gt;is_valid) 
      {
          $error = "De code die je in hebt getypt is ongeldig. Probeer het nog eens.";
      }
  $espacios = count_chars(@$_POST['bean_name'], 1);
  $name = $input-&gt;FilterText($_POST['bean_name']);
  $filter = preg_replace("/[^a-z\d\-=\?!@:\_]/i", "", $name);
  if($user-&gt;validName($_SESSION['quickregister']['bean_name']))
      {
          $Errorz .= 'De naam die je gebruikt is verboden.';
          $State = 1;
      }
  else
      if(!empty($espacios[32]))
          {
              $Errorz .= 'De naam mag geen spaties bevatten.';
              $State = 1;
          }
  
  if($filter != $name){
      $Error .= 'Deze Spacenaam is niet toegestaan&lt;br /&gt;';
      $State = 1;
  }
  if(strlen($_POST['bean_name']) &lt; 3 || strlen($_POST['bean_name']) &gt;= 40)
      {
          $Error .= 'Je Space naam is te lang of te kort.&lt;br /&gt;';
          $State = 1; }
  
  else
      if($user-&gt;NameTaken($_SESSION['quickregister']['bean_name']))
          {
              $Errorz .= "Deze naam is al ingebruik.";
              $State = 1;
          }
      else
          if($user-&gt;EmailTaken($_SESSION['quickregister']['bean_email']))
              {
                  header("Location: ".PATH."/quickregister/duplicateEmailLogin");
                  exit;
              }
          else
              if(!$user-&gt;validar_email($_SESSION['quickregister']['bean_email']))
                  {
                      $Errorz .= 'De e-mail die je hebt ingevoerd is ongeldig.';
                      $State2 = 1;
                  } 
              else
                  if($_SESSION['quickregister']['bean_email'] !== $_SESSION['quickregister']['bean_retypedEmail'])
                      {
                          $Errorz .= 'De e-mails komen niet overeen. Zorg ervoor dat ze hetzelfde zijn.';
                          $State2 = 1;
                          $State3 = 1;
                      }
                  else
                      if(strlen($_SESSION['quickregister']['bean_password']) &lt; 6 || strlen($_SESSION['quickregister']['bean_password']) &gt;= 40)
                          {
                              $Errorz .= 'Het wachtwoord moet minstens 6 karakters zijn.';
                              $State4 = 1;
                          }
  if(isset($Errorz))
      {
          $_SESSION['quickregister']['error'] = $Errorz;
          unset($_SESSION['quickregister']['email_pass']);
          $_SESSION['quickregister']['age_gate'] = true;
          header("Location: ".PATH."/quickregister/email_password");
      }
  if($error == null)
      {
          $_SESSION['PHP_CONECT'] = "habbo";
          $username = $db-&gt;escape_string($_SESSION['quickregister']['bean_name']);
          $password = $input-&gt;HoloHash($_SESSION['quickregister']['bean_password'], $username);
          $look = $input-&gt;FilterText($_POST['bean_figure']);
          $email = $db-&gt;escape_string($_SESSION['quickregister']['bean_email']);
          $gender = $_SESSION['quickregister']['gender'];
          $birth = $_SESSION['quickregister']['bean_birth'];
          $birth = explode('-', $birth2);
          $birth2 = $birth2[2].'-'.$birth2[1].'-'.$birth[0];
          $scredits = "450000";
          $pixels = "6000";
          $motto = "Welkom!";
          $data-&gt;insert1($username,$password,$birth,$look,$motto,$gender,$scredits,$email,$pixels);
          $row = $serverdb-&gt;fetch_row($data-&gt;select3($username));
  
          $serverdb-&gt;query("INSERT INTO ".PREFIX."users (id,name,lastvisit,online,ipaddress_last,newsletter,email_verified,show_home,email_friendrequest,email_minimail,email,show_online) VALUES ('".$row[0]."','".$row[1]."','".time()."','".time()."','".$_SERVER[REMOTE_ADDR]."','1','1','1','1','1','".$email."','1')") or die (mysql_error());
  
  
          $hash = "";
          $length = 8;
          $possible = "0123456789qwertyuiopasdfghjkzxcvbnm";
          $i = 0;
          while ($i &lt; $length) {
              $char = substr($possible, mt_rand(0, strlen($possible)-1), 1);
              if (!strstr($hash, $char)) {
                  $hash .= $char;
                  $i++;
              }}
          $hash = sha1($hash);
          $num = $key;
          $db-&gt;query("INSERT INTO ".PREFIX."verify (id,email,key_hash) VALUES ('".$row[0]."','".$email."','".$hash."')");
          $subject = "Welkom in ".SHORTNAME;
          $to = $email;
          $html = 
              '&lt;html&gt;&lt;head&gt;&lt;style type="text/css"&gt;
      a { color: #fc6204; }
      &lt;/style&gt;&lt;/head&gt;
      &lt;body style="background-color: #e3e3db; margin: 0; padding: 0; font-size: 11px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #000;"&gt;
  
      &lt;div style="background-color: #bce0ee; padding: 14px; border-bottom: 3px solid #000;"&gt;
          &lt;img src="cid:habbologo" alt="http://yabsoon.nl" /&gt;
      &lt;/div&gt;
  
      &lt;div style="padding: 14px 14px 50px 14px; background-color: #e3e3db;"&gt;
          &lt;div style="background-color: #fff; padding: 14px; border: 1px solid #ccc"&gt;
          &lt;h1 style="font-size: 16px"&gt;&lt;font color="black"&gt;&lt;b&gt;Beste '.$row[1].',&lt;/b&gt;&lt;/font&gt;&lt;/h1&gt;
  
          &lt;p&gt;
          Het is belangerijk dat je bevestigt dat dit e-mail addres van jou is, &lt;br /&gt;
      Klik op de volgende link om jou Space account te activeren: &lt;a href="'.PATH.'/email?key='.$hash.'"&gt;'.$lang-&gt;loc['email.verify.2.b'].'&lt;/a&gt;
          &lt;/p&gt;
          &lt;p&gt;
          Bewaar de volgende gegevens veilig:
          &lt;/p&gt;
          &lt;p&gt;
          &lt;b&gt;'.$lang-&gt;loc['email.verify.4'].'&lt;/b&gt; '.$row[1].'&lt;br&gt;
          &lt;b&gt;'.$lang-&gt;loc['email.verify.5'].'&lt;/b&gt; '.$birth.'
          &lt;/p&gt;
  
          &lt;p&gt;
          Heb je je niet geregistreerd op Yabsoon? Klik dan &lt;a href="'.PATH.'/email?remove='.$hash.'"&gt;hier!&lt;/a&gt;
          &lt;/p&gt;
  
  
          &lt;/div&gt;
          &lt;div style="padding: 14px 0; text-align: center; font-size: 10px;"&gt;
                  Copyright © 2006-2012 Space hotel. Alle rechten voorbehouden.
          &lt;/div&gt;
      &lt;/div&gt;
  
      &lt;/body&gt;
      &lt;/html&gt;';
  
  
          $db-&gt;query("INSERT INTO ".PREFIX."homes (ownerid,itemid,x,y,z,skin,location) VALUES ('".$row[0]."','220','252','12','66','defaultskin','0')");
          $db-&gt;query("INSERT INTO ".PREFIX."homes (ownerid,itemid,x,y,z,skin,location) VALUES ('".$row[0]."','10400','38','263','88','defaultskin','0')");
          $db-&gt;query("INSERT INTO ".PREFIX."homes (ownerid,itemid,x,y,z,skin,location) VALUES ('".$row[0]."','10600','59','646','103','defaultskin','0')");
          $db-&gt;query("INSERT INTO ".PREFIX."homes (ownerid,itemid,x,y,z,skin,location) VALUES ('".$row[0]."','10100','437','29','79','defaultskin','0')");
          $db-&gt;query("INSERT INTO ".PREFIX."homes (ownerid,itemid,x,y,z,skin,location) VALUES ('".$row[0]."','10700','438','262','83','defaultskin','0')");
  
          unset($_SESSION['quickregister']);
          $user = new HoloUser($username,$password,true);
          $_SESSION['user'] = $user;
  
          header("Location: ".PATH."/security_check");
  
          exit;
  
      }
  else{
      $_SESSION['quickregister']['error'] = $error;
      header('Location: '.PATHSECURE.'/quickregister/captcha');
      exit;
  }
  ?&gt;
  </code></pre>
  
  <p>I get this error: Incorrect integer value: '' for column 'id' at row 1 Does someone know what i do wrong?</p>