title: Membership with Facebook (Error: MySql)
body: <p>Facebook and Twitter membership script error:
  (does not record data to the database)</p>
  
  <p>Login=>FB/TW DATABASE=><strong>CONNECT OK!</strong>=>BACK TO MY WEBSITE=>MY DATABASE=>ERROR</p>
  
  <p><strong>SQL:</strong></p>
  
  <pre><code>CREATE TABLE users
  (
  id INT PRIMARY KEY AUTO_INCREMENT,
  email VARCHAR(70),
  oauth_uid VARCHAR(200),
  oauth_provider VARCHAR(200),
  username VARCHAR(100),
  twitter_oauth_token VARCHAR(200),
  twitter_oauth_token_secret VARCHAR(200)
  );
  </code></pre>
  
  <p><strong>loginFacebook.php:</strong></p>
  
  <pre><code>&lt;?php
  require 'dbconfig.php';
  class User {
  
  function checkUser($uid, $oauth_provider, $username,$email,$twitter_otoken,$twitter_otoken_secret) 
  {
      $query = mysql_query("SELECT * FROM `users` WHERE oauth_uid = '$uid' and oauth_provider = '$oauth_provider'") or die(mysql_error());
      $result = mysql_fetch_array($query);
      if (!empty($result)) {
          # User is already present
      } else {
          #user not present. Insert a new Record
          $query = mysql_query("INSERT INTO `users` (oauth_provider, oauth_uid, username,email,twitter_oauth_token,twitter_oauth_token_secret) VALUES ('$oauth_provider', $uid, '$username','$email')") or die(mysql_error());
          $query = mysql_query("SELECT * FROM `users` WHERE oauth_uid = '$uid' and oauth_provider = '$oauth_provider'");
          $result = mysql_fetch_array($query);
          return $result;
      }
      return $result;
  }
  } ?&gt;
  </code></pre>
  
  <p><strong>Screen: Error</strong></p>
  
  <blockquote>
    <p>Column count doesn't match value count at row 1</p>
  </blockquote>
  
  <p>What's wrong?</p>
  
  <p>best regards,</p>