saraa
Mar 13th, 2007, 02:38 AM
hi all..i want to display fax data which choosed from 2 comboboxes.
one is branch and the other one is month.
The problem here i dont know how to bring a branch value when i choose month..
When i choose a month, it not brings a value of branch together..
Here is my codings.
<?
$month1=$_GET['Month'];
$branch_id=$_GET['branch'];
$queryB = mysql_query("SELECT * FROM branch WHERE code='$branch_id'");
$br=mysql_fetch_array($queryB);
$idB= $br['code'];
$nB=$br['name'];
?>
<form name="form1" id="form1" action="faxin2.php" method="get">
<table width="90%" border="0" align="center" cellpadding="0" cellspacing="3" >
<tr>
<td><div align="right"></div></td>
<td> </td>
<td align="center">Branch: <select name="branch" onChange="this.form.submit()">
<option value="">Select Branch</option>
<?
$sqlst = mysql_query("SELECT * FROM branch ORDER BY name");
while($branch = mysql_fetch_array($sqlst)){ ?>
<option value="<? echo $branch['code'] ?>"><? echo $branch['name'] ?>
</option>
<? } ?>
</select> <input type="text" name="branch_id" value="<? echo $branch_id;?>"><? echo $nB;?>
<select name="Month" id="Month" onChange="this.form.submit()">
<option value="">Select Month</option>
<option>January</option>
<option>February</option>
<option>March</option>
<option>April</option>
<option>May</option>
<option>June</option>
<option>July</option>
<option>August</option>
<option>September</option>
<option>October</option>
<option>November</option>
<option>December</option>
</select>
<input type="submit" name="Submit" value="Show"></td>
</tr>
<tr>
<td colspan="5"> </td>
</tr>
</table>
</form>
Please letme know how to solve this problem..thanks in advance
one is branch and the other one is month.
The problem here i dont know how to bring a branch value when i choose month..
When i choose a month, it not brings a value of branch together..
Here is my codings.
<?
$month1=$_GET['Month'];
$branch_id=$_GET['branch'];
$queryB = mysql_query("SELECT * FROM branch WHERE code='$branch_id'");
$br=mysql_fetch_array($queryB);
$idB= $br['code'];
$nB=$br['name'];
?>
<form name="form1" id="form1" action="faxin2.php" method="get">
<table width="90%" border="0" align="center" cellpadding="0" cellspacing="3" >
<tr>
<td><div align="right"></div></td>
<td> </td>
<td align="center">Branch: <select name="branch" onChange="this.form.submit()">
<option value="">Select Branch</option>
<?
$sqlst = mysql_query("SELECT * FROM branch ORDER BY name");
while($branch = mysql_fetch_array($sqlst)){ ?>
<option value="<? echo $branch['code'] ?>"><? echo $branch['name'] ?>
</option>
<? } ?>
</select> <input type="text" name="branch_id" value="<? echo $branch_id;?>"><? echo $nB;?>
<select name="Month" id="Month" onChange="this.form.submit()">
<option value="">Select Month</option>
<option>January</option>
<option>February</option>
<option>March</option>
<option>April</option>
<option>May</option>
<option>June</option>
<option>July</option>
<option>August</option>
<option>September</option>
<option>October</option>
<option>November</option>
<option>December</option>
</select>
<input type="submit" name="Submit" value="Show"></td>
</tr>
<tr>
<td colspan="5"> </td>
</tr>
</table>
</form>
Please letme know how to solve this problem..thanks in advance