[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;
	
 ?>

<br> in <select> ???

ask smarter, be specific, what is your problem, is there SQL error in your query?

use mysql_error() to know your query is running without a problem.

use the code bbtag while you're posting in this forum to highlight your code, please.

use the isset() to know which variable has set before:

<?php
if(isset($_REQUEST['cls']))
{
//do something
}

if(isset($_REQUEST['srr']))
{
// print the link
}
?>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.