The below code does not display the price value.
With line : $msg = 'Your Price is £' . $price;
when I echo the value of $msg, it displays like this: Your Price is £
Whereas With line : $msg = 'Your Price is £' . $row['price'];
when I echo $msg, it displays the price. Your Price is £64
what is wrong with the below code? It was working perfect few minutes back when the code was in the same php page. Now I wanted to use AJAX so I copied this code in a seperate page.
I want to know why this happens.
Any help or suggestion is appreciated.
$price = $row['price'];
$id = $row['id'];
//write id & price to session
$_SESSION['price'] = $price;
$_SESSION['id'] = $id;
$_SESSION['description'] = $description;
$_SESSION['colors'] = $colours;
$msg = 'Your Price is £' . $price;