0

I have a some text saved in a MySql database that contains a mathematical symbol. When I read this from php code it become something like this α=? and β=?

Text in database:

<p>A round balloon of radius r subtends an angle α at the eye of the observer, while the angle of elevation of the centre is β. The height of the centre of balloon is </p>

Text read from php:

<p>A round balloon of radius r subtends an angle ? at the eye of the observer, while the angle of elevation of the centre is ?. The height of the centre of balloon is </p>

How to solve this problem?

Ethan
  • 4,295
  • 4
  • 25
  • 44
brij
  • 47
  • 1
  • 6

1 Answers1

1

Most likely is that your database and php don't share the same character set. You should set all of your systems to (for instance) UTF-8 so that characters may be shared between systems.

In your html/php page:

<meta charset=utf-8" />

In your database you should also ensure the charset is set to UTF-8

There is a detailed example here in this answer to someone else's query. It wasn't picked as the answer but the information is very clear:

Cannot properly insert greek characters in mysql database

Wittner
  • 583
  • 5
  • 21