Jump to content

drop down box Pblm


shan_cool

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.