319 posts
  • Sold between 10 000 and 50 000 dollars
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Referred between 100 and 199 users
  • Bought between 50 and 99 items
  • Has been a member for 3-4 years
  • Microlancer Beta Tester
  • Exclusive Author
  • Portugal
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.

319 posts
  • Sold between 10 000 and 50 000 dollars
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Referred between 100 and 199 users
  • Bought between 50 and 99 items
  • Has been a member for 3-4 years
  • Microlancer Beta Tester
  • Exclusive Author
  • Portugal
vtimbuc says

bump

2823 posts
  • Australia
  • Community Moderator
  • Elite Author
  • Author had a Free File of the Month
  • Most Wanted Bounty Winner
  • Author had a File in an Envato Bundle
  • Has been a member for 5-6 years
  • Contributed a Blog Post
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
+10 more
dtbaker Volunteer 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 ?

158 posts
  • Australia
  • Sold between 10 000 and 50 000 dollars
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 3-4 years
  • Referred between 10 and 49 users
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.

319 posts
  • Sold between 10 000 and 50 000 dollars
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Referred between 100 and 199 users
  • Bought between 50 and 99 items
  • Has been a member for 3-4 years
  • Microlancer Beta Tester
  • Exclusive Author
  • Portugal
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