[TEX]HI FORUM
I WAS TRYING TO FILL THE COMBOBOX WITH THE VALUES IN DATABASE, AND MY CODE IS ALSO DISPLAYING THOSE VALUES BUT THE PROBLEM WHAT I FEEL IS THAT <OPTION VALUE > IS NT WORKING WELL BECAUSE WHEN I TRY TO DISPLAY THE VALUE OF SELECT IT DOES NOT DISPLA SOMETHING HERE IS THE CODE [/TEX]
<?php
$dbhandle = mysql_connect('localhost', 'root', '');
if ($dbhandle == false)
{
die ("Unable to connect to MySQL Database<br>");
}
if(!($db = mysql_select_db('registration'))){
echo "byeeeeeeeeeeeeeeeeeeeeeeeeeeee";
}
$tab=$_REQUEST['cls'];
$roll;
$clas=$_REQUEST['cls'];
echo $clas;
$q="select ser as mxid from Table2 where subject='".$clas."'";
if(!($result = mysql_query($q))){
echo "whoooooooooooooooooooooops";
}
$sr;
echo" <select name='srr'> <option value='' selected=selected>select </option>";
while($rp=mysql_fetch_row($result)){
$sr=mysql_result($rp, "mxid");
echo "<br> <option value='".$rp[0]."'>".$rp[0]."</option>";
}
echo "</select>";
$roll=$_REQUEST[srr];
echo $roll;
echo "<a href='viewrecord.php? &i=$roll'> v i e w </a>";
echo $roll;
?>