Jump to content

setting character set


jimfog

Recommended Posts

Whenever I make a connection to the db and perform whether this an update, a select or an insert I always set the chaset to utf8, like this:

$connection->set_charset("utf8");

The question is the above needed in every kind of query.Is it needed for example in a SELECT statement where we do not put in the db?

Link to comment
Share on other sites

I just saw that in PHPMyAdmin,as a server connection collation, is mentioned utf_8_general_ci.

Given that, do you still think the line of code showed above is needed?

Link to comment
Share on other sites

Sorry I did not quite understand your answer.

I suppose you mean that if I want to stick with what the server has already as collation I should NOT use the code I list above.

 

Is that what you mean/

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...