Forums

[resolved] can't insert special character (5 posts)

  1. carlla
    Member
    Posted 2 years ago #

    I am trying to insert data in a plugin table, but everytime I try to insert a special character the field value stop on the first one. In other words, if I try insert the value "joão", it is inserted as "jo".

    I am using $wpdb->query($my_query). When I print $my_query I can see the correct value and if i paste it in phpmyadmin it work perfectly.

    any suggest ?

  2. s_ha_dum (was apljdi)
    Member
    Posted 2 years ago #

    You probably need to encode the character or change the collation of your database. See if this helps, then Google for "mysql insert special character". There is a lot of material out there.

  3. carlla
    Member
    Posted 2 years ago #

    hm.. it helps a lot =] thank you...

    I tried to insert with a mysql_query php function and didn't get this problem. I was wondering if wpdb->query gives a special treatment in my query before run it.

    I'd like do not record the data as htmlentities, because a flash application will get it after. Would be a little hard to treat it in action script.

    I will try your suggestion. Thank you very much =]

  4. s_ha_dum (was apljdi)
    Member
    Posted 2 years ago #

    I've not done much with Flash but if Flash doesn't support many entities, and it doesn't (I looked it up), will it choke on data coming from a database that has been collated to the charset that you need? Just a thought. I really have no idea what the answer is.

  5. carlla
    Member
    Posted 2 years ago #

    Just change my php editor's settings to save files in utf-8 (it is weird, I know). It seems work fine after I saved the php file again.

Topic Closed

This topic has been closed to new replies.

About this Topic