0

Guys i really need help! I need to retrieve data from the database with checkbox. I need to get sum of the items that were clicked and direct the user in another page to show the result. This is my code

 <?php
$con = mysql_connect('localhost','root','root')or die(mysql_error());
$db = mysql_select_db('rizal',$con)or die(mysql_error());
$acode = $_SESSION['acode'];
$query = mysql_query("SELECT tdno, dueamount FROM taxdue where acode ='$acode'")or die(mysql_error());

 ?>
 <form Method="post" Action="total.php" >
    <table>
    <tr>
         <td width="20%" align="center">  </td>
         <td width="20%" align="center">Tax Declaration </td>
         <td width="20%" align="center">Amount</td>
    <tr>
    <?php  
        while($result = mysql_fetch_assoc($query))
        {
        $i++;
    ?>

          <tr>
            <td width="20%" align="center">
            <input name="<?php echo $result['taxid']?>" type="checkbox" id="<?php echo $result['taxid']?>" value="<?php echo $result['taxid']?>">
            </label></td>
            <td width="20%" align="center"><?php echo $result['tdno']?></td>
            <td width="20%" align="center"><?php echo $result['dueamount']?></td>
          </tr>
    <?php
    }
    ?>
             <tr>
            <td align="center"><input type="submit" name="Submit" value="Submit" /></td>
            <td align="center"> </td>
            </tr>
            </form>
          </table>
2
Contributors
1
Reply
9
Views
5 Years
Discussion Span
Last Post by LastMitch
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.