Reputation: 215
I've a mysql db with some special characters, an input form, some php pages.
In my first php page (requestPage) I have the input form.
This page sends (through GET) a parameter to an other php page (ResultsPage).
At last this php page (ResultsPage) send a query with the parameter to the dbms and shows results.
RequestPage is encoded as utf-8 through
ResultsPage is encoded as utf-8 through
The database and its tables are encoded as utf8_general_ci.
Now, for instance:
Any suggestion?
Upvotes: 1
Views: 169
Reputation: 215
I've solved the problem with this string added in the php resultsPage file:
mysql_query("SET character_set_results = 'utf8', character_set_client='utf8', character_set_connection = 'utf8', character_set_database = 'utf8', character_set_server = 'utf8'", $connection);
Obviously it has to be inserted after this string:
$connection = mysql_connect($servername,$username,$dbpassword);
Upvotes: 1