How Do I Say If This Statment Is Being Presented Then Show THis Else SHow That
this may be bad coding but i just want to know how i can show this form i have if the 'if' part of the second sql statement is successful. 

        <?php 
    $id = $_GET['election'];
    
    $result = mysql_query("SELECT * FROM votes WHERE election_id = '$id' AND ni = '". $_SESSION['ni']."'" )
    	
    or die(mysql_error());
    
    if (mysql_num_rows($result) == 0) {
    	
       $sql="SELECT * FROM elections WHERE status = 'in_progress' AND election_id = '$id'";
    
    $result=mysql_query($sql);
    
    $options="";
    $party2="";
    $party3="";
    
    while ($row=mysql_fetch_array($result)) {
    	
    	echo "<tr>";
    	echo "<td><h5>" . $row['name_of_election']. "</h5><hr></td>";
    	echo "</td>";
    	
    	
        $idd=$row["party1"];
        $thing=$row["party1"];
        $options.="<OPTION VALUE=\"$idd\">".$thing;
    	
    	$idd=$row["party2"];
        $thing=$row["party2"];
        $party2.="<OPTION VALUE=\"$idd\">".$thing; 
    	
    	$idd=$row["party3"];
        $thing=$row["party3"];
        $party3.="<OPTION VALUE=\"$idd\">".$thing;
    }
    	
        } else {
    		echo 'You Cannot Vote Anymore';
    	}
      ?>
      
    
      <form action="votecasted.php?election=<?php echo $id; ?>" method="post">
    
        <span id="spryselect1">
        <label for="vote">Vote</label>&nbsp;
        <select size=1" name="vote" id="vote">
            <option selected="selected">Select Your Desired Party</option>
            <?=$options?>
            <?=$party2?>
            <?=$party3?>
    </select>
        <span class="selectRequiredMsg">*</span></span><br />
        
    <br />    <input name="" type="submit" value="Vote" />
      </form>
    </div><!-- End of Column 2-->


how do i include my form in the if statement of the second sql command? sorry if its to confusing to understand..

How Do I Say If This Statment Is Being Presented Then Show THis Else SHow That
===

this may be bad coding but i just want to know how i can show this form i have if the 'if' part of the second sql statement is successful. 

        <?php 
    $id = $_GET['election'];
    
    $result = mysql_query("SELECT * FROM votes WHERE election_id = '$id' AND ni = '". $_SESSION['ni']."'" )
    	
    or die(mysql_error());
    
    if (mysql_num_rows($result) == 0) {
    	
       $sql="SELECT * FROM elections WHERE status = 'in_progress' AND election_id = '$id'";
    
    $result=mysql_query($sql);
    
    $options="";
    $party2="";
    $party3="";
    
    while ($row=mysql_fetch_array($result)) {
    	
    	echo "<tr>";
    	echo "<td><h5>" . $row['name_of_election']. "</h5><hr></td>";
    	echo "</td>";
    	
    	
        $idd=$row["party1"];
        $thing=$row["party1"];
        $options.="<OPTION VALUE=\"$idd\">".$thing;
    	
    	$idd=$row["party2"];
        $thing=$row["party2"];
        $party2.="<OPTION VALUE=\"$idd\">".$thing; 
    	
    	$idd=$row["party3"];
        $thing=$row["party3"];
        $party3.="<OPTION VALUE=\"$idd\">".$thing;
    }
    	
        } else {
    		echo 'You Cannot Vote Anymore';
    	}
      ?>
      
    
      <form action="votecasted.php?election=<?php echo $id; ?>" method="post">
    
        <span id="spryselect1">
        <label for="vote">Vote</label>&nbsp;
        <select size=1" name="vote" id="vote">
            <option selected="selected">Select Your Desired Party</option>
            <?=$options?>
            <?=$party2?>
            <?=$party3?>
    </select>
        <span class="selectRequiredMsg">*</span></span><br />
        
    <br />    <input name="" type="submit" value="Vote" />
      </form>
    </div><!-- End of Column 2-->


how do i include my form in the if statement of the second sql command? sorry if its to confusing to understand..
