This question already has an answer here:
I am trying to understand why am I getting this error :
PHP Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING)
public function display(){
$sql = "SELECT * FROM `gift_cards`";
$resultset= mysqli_query($con,$sql);
while($rows= mysqli_fetch_assoc($resultset)){
echo "<option value="."\"$rows['GIFT_CARD_ID']\"><h2>"."$rows['PRICE']</h2></option>";
}
}
HTML:-
<select placeholder="GiftCards" id="a" name="a" value="">
<?php $giftCards->display(); ?>
</select>
echo "<option value='" . $rows['GIFT_CARD_ID'] . "'><h2>" . $rows['PRICE'] . "</h2></option>";
A go :) – Matt Jan 17 '16 at 3:35