how to make count in multiple selected student id
<p>i have two tables, initial_vote and studinfo. on initial_vote table, it compose of userid and the choices1-4(studid), i store here the info where the selected student id's are not yet counted. in the studinfo table, this is where i want to have counting on the numvote column.</p>

<p>initial_vote table</p>

<pre><code>     userid     choice1    choice2     choice3     choice4
     12345      c-1234     c-1134      c-1222      c-1345 
     23456      c-1674     c-1534      c-1342      c-1444
</code></pre>

<p>studinfo table</p>

<pre><code>     studid     fname    lname     mname     numvote
     c-1234     maria    cruz      santos       
     c-1134     juan     santos    cris
     c-1222     borg     sample    bern
     c-1345     joy      girl      cute
</code></pre>

<p>i manage to get the studid of choices1-4 of user from the initial_vote shown like this</p>

<pre><code>      $vote$_SESSION['userid'];
     function getinfo2($info2){
    global $voter; //lets say the userid here is 12345
    $info_select = "SELECT `$info2` FROM `initial_vote` WHERE `voter_studid`='".mysql_real_escape_string($voter)."'";
            if ($query_get = mysql_query($info_select)) { 
            if ($result = mysql_result($query_get, 0, $info2)) {
            return $result;
            }
            }
            }
     $c1 = getinfo2('choice1'); $c2 = getinfo2('choice2'); 
     $c3 = getinfo2('choice3'); $c4 = getinfo2('choice4');
</code></pre>

<p>but my problem now is, how could i add or make a function to count the selected studid's in the final_vote table(numvote column) as i click a submit button. i try my best but it didnt  work.  </p>

<pre><code> if($_POST['submit']{
    // ????
 }else { echo "Not added"; }
</code></pre>
