I have a simple database where I have trip descriptions for a trip. In the database, the trip descriptions include apostrophes and enters/returns, it is type: text.
I want to retrieve and echo out all of the trip descriptions (there are a lot of them) onto a website, however the apostrophes, hyphens, and other special characters are turning into � and the enters/returns just aren't there.
For example, the following text in the database:
We'll arrive in New Georgia to paddle around the famous Marovo Lagoon - the world's largest salt water lagoon - for seven days.
We will return to...
gets displayed on the webpage as
We'll arrive in New Georgia to paddle around the famous Marovo Lagoon � the world�s largest salt water lagoon � for seven days. We will return to...
The "We will return to..." is not in a new paragraph, and the apostrophe and two hyphens are �
Here is my php code:
$tripResult = mysql_query("SELECT * FROM trips");
while($row = mysql_fetch_array($tripResult)){
echo $row['tripDescription'];
}
I've tried replacing the echo line with
echo htmlspecialchars($row['tripDescription'], ENT_QUOTES);
But this displays no text at all.
EDIT: I have also tried checking that I have a charset meta tag, changing the database collation to utf8mb4_general_ci (the closest one to utf8mb4 I could find in the dropdown list), and replacing the echo with:
echo mysql_set_charset($row["tripDescription"]);
However it still displays no text at all. How can I make this text look normal?