i have 3 variables $page_no,$noc_no,$doc_no
these are coming from 3 different drop down on other page
only one is active at a time i want to assign one of the variable to variable in select statement ie $card_id at a time


//echo $noc_no;

//echo $doc_no;

//echo "card_id1=".$card_id;
//echo "yr=$yr<br>";

<form action="right.php" name="search_noc1" method="POST">
<table border=0>

//echo "hello";

	if($card_id != 0)
	//echo "card_id2=$card_id<br>";
		echo "<div >";
		echo "<table  border='0'  width='100%'>";
		echo "<tr><td align='right'>";
		//If no Judgement Text is entered for this card, do not show "View Judgement Button"

		$get_judgement=mysql_query("SELECT count(*) as cnt FROM judgmenttext where anCardId=".$card_id);
		//echo $get_judgement;

you can use either use

if ( $page_no != 0 )  { 
$card_id = $page_no;
} elseif ( $noc_no != 0 )  { 
$card_id = $noc_no;
} elseif ( $doc_no != 0 )  { 
$card_id = $doc_no;

or you can also assign the selected value from the database which shud be assigned to $card_id to a hidden variable from the page where you are passing the values from the select box.