Web Analytics Made Easy -
StatCounter PHP, MySql- utf8_encode returns unknown character, How to convert? - CodingForum

Announcement

Collapse
No announcement yet.

PHP, MySql- utf8_encode returns unknown character, How to convert?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • PHP, MySql- utf8_encode returns unknown character, How to convert?

    PHP, MySql- utf8_encode returns unknown character, How to convert?
    Need some help tips.

    Input data = “6-6½” -> save data -> retrieve data from db -> 6-6ؤ

    Client post this data to server
    $STRCOL9 = utf8_encode(str_replace("SELECT","",$_REQUEST['FRMSTRCOL9']));

    Save data using the following character data set.
    Mysql dataType: varchar
    Collation: utf8_unicode_ci
    mysql_query("SET character_set_client=utf8", $dbObject->create());
    mysql_query("SET character_set_connection=utf8", $dbObject->create());
    if (!mysql_query($AddData, $dbObject->create()))

    Using utf8 character set for data retrieval
    mysql_query("SET character_set_results=utf8", $dbObject->create());
    $res = mysql_query($sql, $dbObject->create());

  • #2
    Have a try by executing the following query before insert and select.
    PHP Code:
    mysql_query("SET NAMES 'utf8'"
    Digitalocean Cloud Hosting (Referral link - get $10 free credit) Fameco

    Comment

    Working...
    X