SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: more utf-8 woes

Hybrid View

  1. #1
    SitePoint Wizard tgavin's Avatar
    Join Date
    Feb 2003
    Location
    FL
    Posts
    1,051
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    more utf-8 woes

    MySQL charset: UTF-8 Unicode (utf8)
    MySQL connection collation: utf8_unicode_ci
    Database Collation: utf8_unicode_ci
    All tables: utf8_unicode_ci
    All varchar, chars, etc.: utf8_unicode_ci
    Server version: 4.1.22-standard
    PHP 5

    Why is it, that when I type , etc. into phpMyAdmin I see the characters as intended. However, when posting directly into mysql ($_POST['foo']) using PHP 5, and then looking at them again in phpMyAdmin I see crap?

    if I print_r($_POST) in the PHP page, the characters are there, perfect.
    If I insert directly via the post
    Code MySQL:
    INSERT INTO foo (field) VALUES ($_POST['foo'])
    I see crap.

    It's only after the INSERT that I see the problem.

  2. #2
    SitePoint Wizard tgavin's Avatar
    Join Date
    Feb 2003
    Location
    FL
    Posts
    1,051
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I fixed it. I modified my.cnf with
    Code:
    init-connect='SET NAMES utf8'


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •