Hi StackOverflow friends,
I am storing temperature in my database but I cannot add the degree symbol. My code is:
$que = "Insert into tblTempForecast (DateTimePosted, Now, Tomorrow) VALUES(now(),'$CloseLow1 ° - $CloseHi1 °','$CloseLow2 ° - $CloseHi2 °')";
$insertTemp = mysql_query($que);
My $CloseLow1
is equal to 15 and $CloseHi1
is 20. $CloseLow2
is 18 and $CloseHi2
is 22.
However, with my code above, it only inserts the $CloseLow1
and CloseLow2
. It is supposed to insert the ff on the database:
ID (auto) DateTimePosted Now Tomorrow
1 2013-11-18 15:25:48 15°-20° 18°-22°
htmlentities
or htmlspecialchars
on the fetched values.°
issue to your page rendering script rather than wrestle with DB character encodings.Sorry if I don't solve directly your issue, but I think that you'll be better off in the long run if you take the high road and tackle the root of the problem rather than the superficial issue.
Expecially n° 4. Really, consider that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With