Author Topic: [SOLVED] Russian Text in MySQL and PHP  (Read 702 times)

0 Members and 1 Guest are viewing this topic.

Offline cmgmyrTopic starter

  • Devotee
  • Posts: 1,345
  • Gender: Male
    • View Profile
    • Modo Media Group
[SOLVED] Russian Text in MySQL and PHP
« on: April 02, 2008, 03:21:56 PM »
I have a database that will eventually have to be used for english, russian, spanish, and a few other languages. Right now I'm adding the russian to it, but when it outputs to the PHP page all I get are question marks. It's showing correctly in phpMyAdmin, but not when it's echoed. Can anyone point me in the right direction?

Thanks,
-Chris

Offline effigy

  • Staff Alumni
  • Freak!
  • *
  • Posts: 7,301
  • Gender: Male
  • We must be the change we wish to see in the world.
    • View Profile
Re: Russian Text in MySQL and PHP
« Reply #1 on: April 02, 2008, 03:29:00 PM »
Are you using UTF-8 across the board--in your table, meta tag, and during PHP's connection to MySQL?
Regexp | Unicode Article | Letter Database
/\A(e)?((1)?ff(?:(?:ig)?y)?|f(?:ig)?)\z/

Offline cmgmyrTopic starter

  • Devotee
  • Posts: 1,345
  • Gender: Male
    • View Profile
    • Modo Media Group
Re: Russian Text in MySQL and PHP
« Reply #2 on: April 02, 2008, 04:30:01 PM »
I have the database and the table set to
Code: [Select]
utf8_unicode_ci this in the header file
Code: [Select]
<meta http-equiv="content-type" content="text/html; charset=utf-8" /> and this right after the database connection
Code: [Select]
$db->query('SET NAMES cp866');

Offline effigy

  • Staff Alumni
  • Freak!
  • *
  • Posts: 7,301
  • Gender: Male
  • We must be the change we wish to see in the world.
    • View Profile
Re: Russian Text in MySQL and PHP
« Reply #3 on: April 02, 2008, 04:43:44 PM »
How about:

Code: [Select]
SET NAMES 'utf8'
SET CHARACTER SET utf8'
Regexp | Unicode Article | Letter Database
/\A(e)?((1)?ff(?:(?:ig)?y)?|f(?:ig)?)\z/

Offline cmgmyrTopic starter

  • Devotee
  • Posts: 1,345
  • Gender: Male
    • View Profile
    • Modo Media Group
Re: Russian Text in MySQL and PHP
« Reply #4 on: April 02, 2008, 04:49:06 PM »
awesome! worked like a charm! thanks!!!