Data truncated for polish letters - utf8_polish_ci

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
Wolfie
Forum Commoner
Posts: 37
Joined: Wed Jan 28, 2009 8:40 am
Location: Poland

Data truncated for polish letters - utf8_polish_ci

Post by Wolfie »

Hello,


I have been serching the problem in my databese cause I get this error :
Data truncated for column 'align' at row 1
And after some reserches I have discover that it is because of my national polish letters, but there is something weird in there cause charset is utf8 and collation is utf8_polish_ci

Enybody knows what shpuld I do ? After some hours of researches I really don't have idea....
david64
Forum Commoner
Posts: 53
Joined: Sat May 02, 2009 8:12 am
Location: Wales

Re: Data truncated for polish letters - utf8_polish_ci

Post by david64 »

When you connect to that database in PHP you have the option to tell the database what character set you are using.

If you are using PDO, you can do this by using the DNS like this: mysql:host=localhost;dbname=db;charset=utf-8;

You can also do it by MYSQL query like this:

Code: Select all

SET CHARSET utf8;SET NAMES utf8;
Post Reply