hii,everyone...
i am new to the forum ..so forgive me if i make some errors in describing my problem
i want to create a drop down menu...the values of which i want to retrieve from a table i have created in my database...
i have been able to acheive this...but i want a second drop down menu...in which i want the values to get filtered according to the selection of the first drop down menu...
i hav a table with the name test...which i am connecting to the first drop down menu
i hav created another table with the name testtype...for second menu..
the id of first table is the testid of second...
plzz help me with creating the second menu...
my code is
<?php
$sql_result = "select test_series FROM test";
$result = mysql_query($sql_result);
?>
<td>Select Test Series </td>
<td>
<select name="testseries" id="testseries" )">
<option>Select</option>
<?php if(mysql_num_rows($result))
{
while($row = mysql_fetch_assoc($result))
{
$test = $row['test_series'];?>
<option><?php echo $test ?></option>
<?php }
}
else {?>
<option>No Names Present</option>";
<?php }
?>
</select>
</td>
</tr>
<tr>
<?php
$testseries = $_POST['testseries'];
$query = "select id from test where test_series = '$testseries'";
$resultt = mysql_query($query) or die(mysql_error());
$row = mysql_fetch_array($resultt);
$id = $row['id'];
$sql_result = "select test_name FROM testtype where testid = $id";
$result = mysql_query($sql_result);
?>
<td>Select Test Name </td>
<td>
<select name="testtype">
<option>Select</option>
<?php if(mysql_num_rows($result))
{
while($row = mysql_fetch_assoc($result))
{
$test2 = $row['test_name'];?>
<option><?php echo $test2 ?></option>
<?php }
}
else {?>
<option>No Names Present</option>";
<?php }
?>
</select>
</td>
</tr>
IN THIS CODE I AM GETTIN AN ERROR Undefined index: testseries in ..addques.php on line 155 WHICH IS THIS ONE $testseries = $_POST['testseries'];