How to change a charset from a table to utf8 in a latin1 database?

1

I am trying to change the charset from a table to utf8 in a BD that contains all the other tables as latin1swedish. I have run several commands and says that it has changed, it shows that that table is the only one like utf8, but any insertion keeps giving errors.

For example, I enter in the endereco field of the coordenadas_cache table, something like: São Sebastião

When I look at phpMyAdmin, it is: São Sebastião

What can I do?

    
asked by anonymous 03.04.2014 / 22:32

1 answer

2

Well, I got it sorted out. As I use mysqli_connect() to connect to the DB, I happen to have a command that directs the charset (for sending, I suppose) from the insert query. The command is $mysqli->set_charset("utf8") , $mysqli being the variable used to connect to the database in the command $mysqli = mysqli_connect("myhost","myuser","mypassw","mybd")

    
04.04.2014 / 03:12