I have an Android app where a user can ask a question. This question is sent to a server which in turn sends it to my e-mail. I respond to the question and the response gets sent back to the server. The response is stored in a MySQL database. The user will poll the server and have the response pulled down onto their phone when it becomes available. When the response is displayed on the phone, the formatting is not right. There are special characters and extra whitespace displaying.
Here is an example of a response when it is sent to the server and placed in the database:
We live in a profit-driven society and the greater good of the people as a whole tends to get thrown to the wayside in favor of increasing one's wealth. Capitalism will not function the way it's intended to when morals are left behind.
When politicians step up to the plate they often aren't batting for the common people, but the highest bidder. It's the lobbyist representing a major corporation or some special interest group who will persuade a politician, through a financial contribution, to put their interests ahead of the interests of the general public. It's favoritism and crony capitalism at its best.
Do I feel the day will come where we'll rise beyond this? I would love to believe so, but at times it feels our current way of life has a stranglehold on us. Whether it be fear or the general lack of critical thinking that keeps people from pursuing the world/society we should have, something must change. We either will hit a breaking point and make our move or this system will continue to operate the way it does. I'll leave you with a famous quote from Edmund Burke, "The only thing necessary for the triumph of evil is that good men do nothing."
Here is what it looks like after it has been pulled down onto a phone(I shortened the misformatted response but the rest of it looks just like this part of it):
We live in a profit-driven society
and the greater good of the people
as a w=
hole tends to get thrown to the
wayside in favor of increasing one's
wealth.=
Capitalism will not function the
way its intended to when morals
are left b=
ehind.When politicians step up to the plate
they often aren't batting for the
comm=
on people, but the highest bidder.
I do this before the response goes into the database:
$message = $dbhandler->real_escape_string($_POST["message"]);
When I create the table with the column that holds the response I assign the column the TEXT field.
I don't understand what's happening to the response either when its placed into the database or pulled from it. It has those equals signs and extra whitespace in it. Can somebody shed some light on this and offer up a remedy?
EDIT
I retrieve the response from the database like this:
$response = $dbhandler->query("SELECT response FROM qar WHERE id='$rowId'");
$row = $response->fetch_row();
if($row[0] != NULL) {
echo($row[0]);
}