title: php/mysql login system gives errors MySQL Error: ()
body: <p>when i run the code i get mysql error() and i get Error in Query Execution.Error : Problem In Executing the Query:</p>
  
  <pre><code>insert into kyaami_user_logins set `user_id` = '32', `email` = 'test@test2.com', `ip` = , `timestamp` = NOW(), `state` = 'success', `active`=1
  </code></pre>
  
  <p>MySQL Error: ()</p>
  
  <pre><code>&lt;?php
  if ( isset( $_GET['msg'] ) )
      {
    if ( $_GET['msg'] == 1 )
      echo "Invalid User. Try Again.";
    if ( $_GET['msg'] == 2 )
      echo "Account Activated Successfully.";
    if ( $_GET['msg'] == 3 )
      echo "Your Account is Locked. contact Administrator.";
    if ( $_REQUEST['msg'] == 4 )
      echo "Mail has been sent to your email address.";
    if ( $_REQUEST['msg'] == 5 )
      echo "Your Account is already activated, Login Here";
    if ( $_REQUEST['msg'] == 6 )
      echo "Your Activation link has been expired, please register again";
       }
  ?&gt;
  &lt;/span&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td width="70" align="right" valign="top"&gt;&lt;p class="form_text" style="color:#FFF;" align="right"&gt;&lt;strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Email&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;
    &lt;td width="410"&gt;&lt;div class="form_input_BG"&gt;&lt;input type="text" name="username" id="username" value=""/&gt;&lt;/div&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td valign="top"&gt;&lt;p class="form_text" style="margin-left:8px; color:#FFF;"&gt;&lt;strong&gt;Password&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;
    &lt;td align="left"&gt;&lt;div class="form_input_BG"&gt;&lt;input type="password" name="pwd" id="pwd" value=""/&gt;&lt;/div&gt;
    &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;&amp;nbsp;&lt;/td&gt;
    &lt;td&gt;&amp;nbsp;&amp;nbsp;&lt;strong&gt;&lt;a href="index.php?page=forgot_pwd" &gt;Forgot your password?&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;&amp;nbsp;&lt;/td&gt;
    &lt;td&gt;&lt;div class="form_login_signup_btn"&gt;
  &lt;input title="login Now" type="image" src="images/login_btn.png" name="formSubmit" id="login" width="104" height="33" /&gt; &lt;!--&lt;input type="image" src="images/signup_btn.png" title="Signup Now" name="signup" id="signup" /&gt;--&gt;&amp;nbsp;&amp;nbsp;&lt;a href="fbconnect.php"&gt;&lt;img src="images/fconnect-but.gif" width="89" height="21" border="0"&gt;&lt;/a&gt; &amp;nbsp;&amp;nbsp;&lt;a href="twit_redirect.php"&gt;&lt;img src="images/sign-in-with-twitter.png" width="151" height="24" alt="Sign in with Twitter" border="0" /&gt;&lt;/a&gt;
      &lt;/div&gt;
    &lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="clr"&gt;&lt;/div&gt;&lt;/div&gt;
  &lt;div class="clr"&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>