340 posts
  • Has referred 100+ members
  • Has sold $10,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 50+ items on Envato Market
+6 more
vtimbuc
says

Hi guys,

I have a little problem. On a wordpress site I have a form on a page where I can submit info that is saved on the database. The problem is that when I use special characters they are not saved in utf-8 so I have to go to the WP-Admin and fix that characters.

How can I set to save the data on database using the utf-8 charset.

Thanks.

340 posts
  • Has referred 100+ members
  • Has sold $10,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 50+ items on Envato Market
+6 more
vtimbuc
says

bump

5410 posts
  • Has sold $750,000+ on Envato Market
  • Helps us moderate the forums
  • Won a competition
  • Has been part of the Envato Community for over 6 years
+20 more
dtbaker
Moderator
says

can you post some code so we can see how the characters are saved to the database? can you post a link to the page so we can see what the form / html looks like that is submitting the data ?

179 posts
  • Has sold $10,000+ on Envato Market
  • Had an item that was trending
  • Located in Australia
  • Sells items exclusively on Envato Market
+3 more
michaeldale
says

First you need to make sure the table was created with UTF -8 and secondly when connecting to the database you need to set it to UTF -8 with “SET NAMES utf8” before doing any queries.

340 posts
  • Has referred 100+ members
  • Has sold $10,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 50+ items on Envato Market
+6 more
vtimbuc
says

Hey guys, I don’t have access to the DB so I can’t see if the table was created in utf-8. But here is the link to the page code http://vtimbuc.net/dev/code.html . Thanks

by
by
by
by
by
by