Setting the character set


show more Setting the character set provides you with in-depth training on Developer. Taught by David Powers as part of the Accessing Databases with Object-Oriented PHP show less
please wait ...

Setting the character set

If you work exclusively in English, you probably don't need to worry about the character set used by MySQL. But, if you work with languages that use accented characters, or different writing systems, the character set used by MySQL effects the way PHP handles quotes and character escaping, when interacting with the database. This has important security implications when handling user input from online forms. Ideally, the character set should be set on the database server. However, it can be changed using SQL statements.

For example, set names utf8, or set character set utf8, will change the character set for the current connection. But, there's an important catch. PHP will not use the character set defined by a query when handling quotes and escaping characters. You must use the MySQLi set_charset() method. To set the character set, open MYSQLi_connect.php in the includes folder. And, call the set, jar set method, on the database connection object, like this. So, it's db, the arrow operator,...

Setting the character set
Video duration: 1m 57s 3h 47m Intermediate

Viewers:

Setting the character set provides you with in-depth training on Developer. Taught by David Powers as part of the Accessing Databases with Object-Oriented PHP

Subject:
Developer
Software:
PHP
Author:
please wait ...