Greetings List,

I need some help understanding what is happening with the following
scenario I am going to explain.  Please feel free to say RTFM and
point me to a link that can clear this up for me.  I have searched
Google with all sorts of different keywords and haven't been able to
figure out what to do.

Now with the examples.  I created a database with the following schema:

CREATE TABLE `news` (
 `newsId` int(11) NOT NULL auto_increment,
 `title` varchar(255) character set utf8 collate utf8_unicode_ci default NULL,
 `subTitle` varchar(255) character set utf8 collate utf8_unicode_ci
default NULL,
 `contact` varchar(255) character set utf8 collate utf8_unicode_ci
default NULL,
 `newsTs` int(11) default NULL,
 `description` text character set utf8 collate utf8_unicode_ci,
 `imageId` int(11) default NULL,
 PRIMARY KEY  (`newsId`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ;


Then using PHP I submitted a form that created the record below:

mysql> select newsId, title from news WHERE newsId=5;
+--------+-----------------------------------------------+
| newsId | title                                         |
+--------+-----------------------------------------------+
|      5 | На берегу пустынных волн |
+--------+-----------------------------------------------+
1 row in set (0.00 sec)

From the mysql command line client I am able to read this record and
everything looks great.  If I view this record from the PHP page
everything looks great.  If I modify the record using my PHP form it
will submit back and save most of the caracters.  With some characters
it messes up completely turning them into symbols or question marks.

I am using the Mbstring extension so I thought as long as I use that
along with a UTF-8 database everything would be okay.

Also when I export this data from the DB, if I use PHPMyAdmin to
export the table I end up with a record that looks like this:

INSERT INTO `news` (`newsId`, `title`, `subTitle`, `contact`,
`newsTs`, `description`, `imageId`) VALUES (5, 'На берегу
пустынных волн', 'test news', 'test news', 1148356800,
'AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz', NULL);

If I export the table using MySQL Administrator backup, I get the same
unusable garbage.  Any pointers would be greatly appreciated.

Thanks in advance!

Reply via email to