tags:

views:

56

answers:

2

Hello. I'm trying to create a script that copies data from an old legacy mysql database into my new utf-8 formatted database.

One particular field is causing me trouble, its a latin1 field - and one record has the following in it:

!-#$%'&*£¥

When the update is performed, I get the following error message:

Zend_Db_Statement_Exception: SQLSTATE[HY000]: General error: 1366 Incorrect string value: '\xA3' for column 'messageContent' at row 1 in C:\xampp\htdocs\portal\ library\Zend\Db\Statement\Pdo.php on line 234

Now, I'd like to strip characters that cause a problem, but other than checking ord($character) <= 126 I don't know what to do. I'm worried that my method might lose valuable data.

I am using MySQL 5.1.43 on Windows 7 - with PHP 5.3.1

A: 

Are you just trying to convert your database? If so read this link that should give you some tips on converting it, and there is a script there that might work.

Viper_Sb
No, I'm trying to copy fields from one table to another. The source table is written by someone else, and I cannot change it.
Chris
A: 

Found a problem with a function deeply nested in some classes that was the problem....

Chris
By all means, share the exact answer with the group...
Wrikken