if ($roles[$i]['ID'] == $product["Sub_Type"]) { //select first option echo "<option selected='selected' value='" . $roles[$i]["ID"] . "'>" . $roles[$i]["Name"] . "</option>"; } else { echo "<option value='" . $roles[$i]["ID"] . "'>" . $roles[$i]["Name"] . "</option>"; } } ?> </select> <br/> <label for="promotion_id">Promotion_ID : </label> <select name="promotion_id" id="promotion_id"> <?php $roles = ProductController::GetProductPromotions(); for ($i = 0; $i < count($roles); $i++) { if ($i == $product["Promotion_ID"]) { //select first option echo "<option selected='selected' value='" . $roles[$i]["ID"] . "'>" . $roles[$i]["Name"] . "</option>"; } else { echo "<option value='" . $roles[$i]["ID"] . "'>" . $roles[$i]["Name"] . "</option>"; } } ?> </select> <br /> <label for="present_type">Present_Type : </label> <select name="present_type" id="present_type"> <?php