title: My php script only reads the first row from mysql and doesn't check the rest of the rows for matches
body: <p>I'm trying to write a script for users to register to a club, and it does all the validation stuff properly and works great until it gets to the part where its supposed to check for duplicates. I'm not sure what is going wrong. HELP PLEASE!!!
  Thank you in Advance,</p>
  
  <pre><code>  &lt;?php 
    mysql_connect ("sqlhost", "username", "password") or die(mysql_error());
  
    mysql_select_db ("databasename") or die(mysql_error());
  
    $errormsgdb = "";
    $errordb = "Sorry but that ";
    $error1db = "Name";
    $error2db = "email";
    $error3db = "mobile number";
    $errordbe = " is already registered";
    $pass1db = "No Matching Name";
    $pass2db = "No Matching Email";
    $pass3db = "No Matching Mobile";
    $errorcount = 0;
    $qResult = mysql_query ("SELECT * FROM table");
    $nRows = mysql_num_rows($qResult);
    for ($i=1; $i&lt; $nRows+1; $i++){
  
  $result = mysql_query("SELECT id,fname,lname,dob,email,mobile,agree,code,joindate FROM table WHERE fname = '$ffname");
  if ($result &gt; 0) {
  $errorcount = $errorcount++;
  $passdb = 0;
  $errormsgdb = $error1db;
  echo "&lt;div class=\"box red\"&gt;$errordb $errormsgdb
  } else {
  $pass = 1;
  $errormsgdb = $pass1db; 
  echo "&lt;div class=\"box green\"&gt;$errormsgdb&lt;/div&gt;&lt;br /&gt;";
  }
  
  
  
    //--------------- Check if DB checks returned errors ------------------------------------&gt;
          if($errorcount &lt;= 0){
          $dobp = $_REQUEST['day'].'/'.$_REQUEST['month'].'/'.$_REQUEST['year'];
          $dob = $_REQUEST['year'].$_REQUEST['month'].$_REQUEST['day'];
          //header('Location: thankyou.php?ffname='.$ffname.'&amp;flname='.$flname.'&amp;dob='.$dob.'&amp;femail='.$femail.'&amp;fmobile='.$fmobile.'&amp;agree='.$agree.'&amp;code='.$code.'&amp;dobp='.$dobp);
          echo "&lt;div class='box green'&gt;Form completed! Error Count = $errorcount&lt;/div&gt;";
          } else {
          echo "&lt;div class='box red'&gt;There was an Error! Error Count = $errorcount&lt;/div&gt;";
              }
    }
       ?&gt;
  </code></pre>