Why does this conditional run, even if not true?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



$c is a field in an array I have loaded in from a text file. For some reason, none of the conditionals branch off and I end up printing out error messages for every row in the text file. My brackets are balanced, I just didn't include the bottom part:
    
If ($c==9)
    {
    If($fieldarray[3]=="P") 
    {
    
     $reject=validate($fieldarray[0],$c,$connectionSDWIS, $fieldarray[$c],$c);
 
This If statement runs even if $reject = "YES". Can't figure out why:
 
                                         
     if ($reject=="NO")
      {
       //////////////////////////////////////////////////////////////////////////////////////////////////
       //loop through the rows in the this text file checking for Original ID of Repeat
       //////////////////////////////////////////////////////////////////////////////////////////////////
       $handle2 = fopen ($uploadfileandpath,"r");
       while ($field2array = fgetcsv ($handle2, $userfile_size, ",")) 
           {         
           If($field2array[2]!=$fieldarray[$c])
            {
             echo "<br>Field 2 of array 2 text row: ".$field2array[2]."<br>";
             echo "<br>Field 9 of array 1 text row: ".$fieldarray[$c]."<br>";
             $acceptOrReject = "R";              
             $displayrows.="<font color=red><b>See below: Original Sample ID for Repeat does not exist : ".$fieldarray[$c]."</b></font><br>";
       
            }
  
          } //end of while loop
      
        fclose($handle2);
      
      }//end of If($reject =="No")

		
---------------------------------
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.

[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux