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 $roles = ProductController::GetProductPresentTypes(); for ($i = 0; $i < count($roles); $i++) { if ($i == 0) { //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="price">Price : </label> <input name="price" id="price" type="text" value="<?php echo $product["Price"] / 1000;