I am trying to display these centimeters in my dropdownlist along with the price which was put on my value
<label>Select Height</label>
<select name="psheight" id="psheight" style="width:50%;" class="form-control form-control-sm rounded-0" onchange="changeddl(this)" >
<?php
$conn = $pdo->open();
try{
$now = date('Y-m-d');
$stmt = $conn->prepare("SELECT * FROM customize_ps_height");
$stmt->execute();
foreach($stmt as $row){
?>
<option value="<?php echo $row['price'];?> <?php echo $row['height'];?>"><?php echo $row['height']; ?></option>
<?php
}
}
catch(PDOException $e){
echo $e->getMessage();
}
$pdo->close();
?>
</select>
<div class="divheight" class="height-style"></div>
<div class="divprice" class="price-style"></div>
<script>
function changeddl($this){
$($this).next('.divheight').text($this.value>0?("Height: " + $this.value + " ₱"):"");
$($this).next('.divprice').text($this.value>0?("Price: " + $this.value + " ₱"):"");
};
</script>
heres my output but i wanted also to display the centimeter which is selected
