Jump to content

[SOLVED] PHP and MySQL


shane18

Recommended Posts

It goes something like this.

1. Set up all tables and columns that can store non ASCII characters as utf8

2. Save all PHP scripts in UTF-8 without BOM.

3. Declare all HTML pages encodings as utf8

4. Set up PHP to MySQL connection as utf8

- for mysql_connect

mysql_connect('','','');
mysql_query("SET NAMES 'utf8'");

- for mysqli

$db = new mysqli('','','','');
$db->set_charset('utf8');

Link to comment
https://forums.phpfreaks.com/topic/178142-solved-php-and-mysql/#findComment-939324
Share on other sites

thanks man, so my last question is that.... so by following

 

It goes something like this.

1. Set up all tables and columns that can store non ASCII characters as utf8

2. Save all PHP scripts in UTF-8 without BOM.

3. Declare all HTML pages encodings as utf8

4. Set up PHP to MySQL connection as utf8

- for mysql_connect

mysql_connect('','','');
mysql_query("SET NAMES 'utf8'");

- for mysqli

$db = new mysqli('','','','');
$db->set_charset('utf8');

 

my stuff will be fully setup for UTF-8?

Link to comment
https://forums.phpfreaks.com/topic/178142-solved-php-and-mysql/#findComment-941588
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.