Hello,
I've started, recently, a project for my job.
The problem I am facing now is that I prepared a post form to store some data to my mysql database. When I add the data manually with sql commands in phpmyadmin then Greek characters are showing correct while when I use my php page it won't store the data normal. It contains something like that:
πομοπμοπ -> utf8_general_ci (collation)
???????????????? -> greek_general_ci (collation)
My html meta charset is utf-8. My php file is utf-8, so I am guessing the problem is that php don't handle my data correct. Some encoding problem I think.
The problem is only with Greek characters!
Any help would be great!
Encoding Problem Maybe
Page 1 of 12 Replies - 165 Views - Last Post: 11 November 2012 - 03:42 PM
Replies To: Encoding Problem Maybe
#2
Re: Encoding Problem Maybe
Posted 11 November 2012 - 03:36 PM
Hey.
Two common things that cause problems like these are:
If neither of those help, post your code here so we can take a look.
Two common things that cause problems like these are:
- The encoding on the page with the form is incorrect. If the page with the form has an incorrect character encoding declared, the data will be mangled from the beginning, and it will likely never display correctly. Make sure that this page is using UTF-8.
- The MySQL connection is not set up to handle UTF-8. By default, MySQL connections from PHP don't handle UTF-8 data correctly. You need to change the character encoding of the connection to handle such data properly. To do that, execute this command immediately after the connection to MySQL has been created in your PHP code.
SET NAMES 'utf8';
If neither of those help, post your code here so we can take a look.
#3
Re: Encoding Problem Maybe
Posted 11 November 2012 - 03:42 PM
WOW! The second solution solved the problem! Thank you very much!
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote




|