www.webdeveloper.com
Results 1 to 4 of 4

Thread: fetching utf8 data

  1. #1
    Join Date
    Jul 2006
    Posts
    84

    fetching utf8 data

    I have created a table with utf8 character set. My problem is whenever I fetch data from that table, instead of actual utf8 data, mysql_fetch_assoc returns several "?". Is there a way to fetch utf8 data?

    Heres is sample of my code
    <?php
    $con = mysql_connect("localhost","","");
    mysql_select_db("test",$con);
    $res = mysql_query("Select * from test",$con);
    while ($row = mysql_fetch_assoc($res)) {
    print($row['address']);
    }
    ?>

  2. #2
    Join Date
    Aug 2005
    Location
    The Garden State
    Posts
    5,634
    what version of php and mysql are you using?
    Acceptable Use | SQL Forum FAQ | celery is tasteless | twitter

    celery is tasteless - currently needing some UI time

  3. #3
    Join Date
    Jul 2006
    Posts
    84
    mysql 5.0.2
    php 5.1.2

  4. #4
    Join Date
    Aug 2005
    Location
    The Garden State
    Posts
    5,634
    My thoughts are to use the MySQLi API's to connect, rather than MySQL API's. They handle languages better and may resolve this issue, based on description (they understand encodings).
    Acceptable Use | SQL Forum FAQ | celery is tasteless | twitter

    celery is tasteless - currently needing some UI time

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles