in this double condition [else if($test1[0] == "Regular Project" && $test1[0] == "FSA Project")] is not working properly. this is the way to do . or in_array i have to use.

   $sql1 = "SELECT Select_Type,Prj_Id,Status FROM PROJECT_ACTIVE WHERE Memr_Id='$data[0]'";
   $test = mysql_query($sql1);
   $test1 = mysql_fetch_array($test);

   /*echo "<select name='selecttype'>";
   for($i=0;$i<3;$i++)
   {
       echo " value ".$test1[0];
       echo "value 1".$a[0];
       if(in_array($test1[0], $a[i])){
           continue;
       }
       else
       {
           echo "<option value='$a[i]' >$a[i]</option>";             
       }
   }
   echo "<select>";*/




     if($test1[0] == "Regular Project"){
     echo "<select name='selecttype'>
        <option value='TGF Project'>TGF Project</option>
        <option value='FSA Project'>FSA Project</option>
        </select>";
        }

        else if($test1[0] == "FSA Project")
        {
        echo "<select name='selecttype'>
        <option value='Regular Project'>Regular Project</option>
        <option value='TGF Project'>TGF Project</option>
        </select>";
        }

        else if($test1[0] == "TGF Project")
        {
        echo "<select name='selecttype'>
        <option value='Regular Project'>Regular Project</option>
        <option value='FSA Project'>FSA Project</option>
        </select>";
        }
        else if($test1[0] == "Regular Project" && $test1[0] == "FSA Project"){
        echo "<select name='selecttype'>
        <option value='TGF Project'>TGF Project</option>
        </select>";
        }
        else if($test1[0] == "Regular Project" && $test1[0] == "TGF Project"){
        echo "<select name='selecttype'>
        <option value='FSA Project'>FSA Project</option>
        </select>";
        }
        else if($test1[0] == "FSA Project" && $test1[0] == "TGF Project"){
        echo "<select name='selecttype'>
        <option value='Regular Project'>Regular Project</option>
        </select>";
        }
        else
        {
        echo "<select name='selecttype'>
        <option value='Regular Project'>Regular Project</option>
        <option value='FSA Project'>FSA Project</option>
        <option value='TGF Project'>TGF Project</option>
        </select>";
        }

lets assume you have array

$test1 = array("Regular Project", "FSA Project", "TGF Project");

so when you select double condition like this
if ($test1[0] == "Regular Project" && $test1[0] == "FSA Project")
$test[0] contain one value in this moment, its either Regular Project or FSA Project so that why double condition not working.

How can i mention! i will use || instead of &&. i tried with ||,not getting what i expect.

sorry for asking,this is the right way?

else if($test1[0] == "Regular Project" ){
            if($test1[0] == "FSA Project"){
            echo "<select name='selecttype'>
            <option value='TGF Project'>TGF Project</option>
            </select>";
            }
        }

if($test1[0] == "Regular Project" )
in this line $test1[0] contain value "Regular Project" so its impossible to have another value "FSA Project", I suggest have another array or another variable contain other value so we can check like :
if ($test1[0] == "Regular Project" && $test2[0] == "FSA Project")

Thanks,Ya i checked but if the conditoin is like this

else if($test1[0] == "FSA Project" && $test_2[0] == "TGF Project"){

            echo "<option value='Regular Project'>Regular Project</option>";

        }

it should come regular project only! but this is checking single condition

else if($test1[0] == "TGF Project")
        {
        echo "<option value='Regular Project'>Regular Project</option>
        <option value='FSA Project'>FSA Project</option>";
        }
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.