Title: can&#8217;t insert special character
Last modified: August 19, 2016

---

# can’t insert special character

 *  Resolved [carlla](https://wordpress.org/support/users/carlla/)
 * (@carlla)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/database-insert-stop-special-character/)
 * 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 ?

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [s_ha_dum](https://wordpress.org/support/users/apljdi/)
 * (@apljdi)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/database-insert-stop-special-character/#post-1301727)
 * You probably need to encode the character or change the collation of your database.
   See if [this helps](http://dev.mysql.com/tech-resources/articles/4.1/unicode.html),
   then Google for “mysql insert special character”. There is a lot of material 
   out there.
 *  Thread Starter [carlla](https://wordpress.org/support/users/carlla/)
 * (@carlla)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/database-insert-stop-special-character/#post-1301838)
 * 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 =]
 *  [s_ha_dum](https://wordpress.org/support/users/apljdi/)
 * (@apljdi)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/database-insert-stop-special-character/#post-1301893)
 * 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.
 *  Thread Starter [carlla](https://wordpress.org/support/users/carlla/)
 * (@carlla)
 * [16 years ago](https://wordpress.org/support/topic/database-insert-stop-special-character/#post-1302239)
 * 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.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘can’t insert special character’ is closed to new replies.

## Tags

 * [query](https://wordpress.org/support/topic-tag/query/)
 * [special-characters](https://wordpress.org/support/topic-tag/special-characters/)
 * [utf8](https://wordpress.org/support/topic-tag/utf8/)
 * [wpdb](https://wordpress.org/support/topic-tag/wpdb/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 2 participants
 * Last reply from: [carlla](https://wordpress.org/support/users/carlla/)
 * Last activity: [16 years ago](https://wordpress.org/support/topic/database-insert-stop-special-character/#post-1302239)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
