Jump to content

Archived

This topic is now archived and is closed to further replies.

shan_cool

drop down box Pblm

Recommended Posts

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..

Thanks
Shan

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.