shan_cool Posted June 5, 2006 Share Posted June 5, 2006 Hi all, I am using PHP with MYSQL to develop a tool,I have to load my combo boxes with values from backend.I have no pblm in ADD screen,In my MODIFY screen while printing the values in the combo box i get the value displayed once in the box and twice in the drop down how can i avoid this?Please let me know if u need any clarifications..ThanksShan Quote Link to comment https://forums.phpfreaks.com/topic/11215-drop-down-box-pblm/ Share on other sites More sharing options...
.josh Posted June 5, 2006 Share Posted June 5, 2006 can you please clarify by posting some code? Quote Link to comment https://forums.phpfreaks.com/topic/11215-drop-down-box-pblm/#findComment-41953 Share on other sites More sharing options...
shan_cool Posted June 5, 2006 Author Share Posted June 5, 2006 Hi,I have a drop down box named sev-stands for severity,This code comes in the modify screen where i retieve severity from dt_defect table.I have a master table where i store all the severity dt_admin.code:// The below query is to retireve the severity for the defect raised<?$rs = mysql_query("select * from dt_defect where defect_id='$id'",$connection)or die ("q1");$myrow=mysql_fetch_array($rs) ?><select style="border-style:none; FONT-SIZE: 10pt; WIDTH: 137px; COLOR: #222222; " name="sev" style="font-size: 10pt" ><OPTION Readonly value="<?php echo $myrow["def_severity"]; ?>"><?php echo $myrow["def_severity"]; ?></OPTION> <?php // The below query is to display all the diff caterory of severity,so tht the user can change the severity.$query=mysql_query("SELECT name FROM dt_admin where category='sev'",$connection ) or die ("cant do it"); while ($result=mysql_fetch_array($query)) { echo '<option value="' . $result['name'] . '">' . $result['name'] . '</option>'; }?> now my pblm is if the severity for eg for the defect is A,Then There is one A displayed in the combo box and then when i click the combo box there are 2 A's displayed in the drop down.How can i display only one A in the combo box?Thanks for the reply,Shan. Quote Link to comment https://forums.phpfreaks.com/topic/11215-drop-down-box-pblm/#findComment-41957 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.