Need some help again. It's been awhile... I have a mySQL record of customers. And a form with a drop down. If there is no data in the database for this drop down (assigned customer), then I want it to let the user select a person to be assigned to that company. This part of the code works. However, if the data already exists in the database, I want to make the drop down already select that person as the assigned customer, however, I also want there to be an option to have that other person be selected at any given time. I also want this code to be as portable as possible, in regards to the fact that if I add another person to the database, then the drop down will populate with the new person as an option selection to assign a company to it.
Hi, Okay here the script that will help you to achieve that <select name="select" id="select"> <option value="test" <?php echo ($rowQuerycustomername=="test")?"selected":"" ?>>Test</option> <option value="test1" <?php echo ($rowQuerycustomername=="test1")?"selected":"" ?>>test1</option> <option value="test2" <?php echo ($rowQuerycustomername=="test2")?"selected":"" ?>>test2</option> <option value="test3" <?php echo ($rowQuerycustomername=="test3")?"selected":"" ?>>test3</option> <option value="test4" <?php echo ($rowQuerycustomername=="test4")?"selected":"" ?>>test4</option> <option value="test5" <?php echo ($rowQuerycustomername=="test5")?"selected":"" ?>>test5</option> </select> PHP: Hope that will work. Regards, Stylesofts Developing Team