Page 1 of 1

Accents problem when inserting on DB

Posted: Thu Jul 09, 2009 9:29 pm
by Stela
Hello…

I created a form for users to input data on a mysql DB. Accents appear OK on the form, I do a echo before the Query to insert the data on DB and no problem with the accents, but when I go to the DB, those accents inserted by the users don't appear OK.

The tables are UTF8 and everything in PHP is encoded in UTF8.

Where might be the problem?

Thanks.

Re: Accents problem when inserting on DB

Posted: Thu Jul 09, 2009 10:04 pm
by Christopher
You need to set the collation for that table/field to support UTF8 probably.

Re: Accents problem when inserting on DB

Posted: Thu Jul 09, 2009 10:33 pm
by Stela
I already did that (forget to mention it).

But I think i did it!!!

What I did was to use ut8_encode when establishing a connection, now everything appears OK. The data already inserted there wasn't changed but all the new data appears OK.

Thanks for the answer.

Re: Accents problem when inserting on DB

Posted: Thu Jul 09, 2009 10:38 pm
by Stela
This is odd.

After inserting a few data, everything was allright, but suddenly the accents on the DB are strange again.

When I put them on a web page they appear OK, but on the DB no.

Is there a problem if they stay like this?