die();
}

$sth = $dbh->prepare('INSERT INTO RainbowTable (combination, hash) VALUES (?, ?)');

$total = 0;

// Generating all the combinations of gestures with length three, four, ..., eight and nine 
for ($x = 3; $x <= 9; $x++) {
  echo "==> Generating table for $x ... \n";

  $p = new Permutations(9, $x);
  
  $combinations = 0;
  
  $values = $p->getCurrent();
  
  do {
    $str = "";
    
    foreach ($values as $value) {
      $str .= chr($value);
    }
    
    $hash = sha1($str);
    
    if ($sth->execute( array( implode(",", $values) , $hash) )) {  
      $combinations++;
    } else {
      echo "Error: ";
      var_dump($sth->errorInfo());