mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-31 17:33:48 +00:00
Set MySQL Attribute for UTF8
This commit is contained in:
@@ -209,28 +209,27 @@ else {
|
||||
if (strlen($db_host) == 0 && strlen($db_port) == 0) {
|
||||
//if both host and port are empty use the unix socket
|
||||
if (strlen($db_create_username) == 0) {
|
||||
$db_dest = new PDO("mysql:host=$db_host;unix_socket=/var/run/mysqld/mysqld.sock;", $db_username, $db_password);
|
||||
$db_dest = new PDO("mysql:host=$db_host;unix_socket=/var/run/mysqld/mysqld.sock;", $db_username, $db_password, array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'));
|
||||
}
|
||||
else {
|
||||
$db_dest = new PDO("mysql:host=$db_host;unix_socket=/var/run/mysqld/mysqld.sock;", $db_create_username, $db_create_password);
|
||||
}
|
||||
$db_dest = new PDO("mysql:host=$db_host;unix_socket=/var/run/mysqld/mysqld.sock;", $db_create_username, $db_create_password, array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8')); }
|
||||
}
|
||||
else {
|
||||
if (strlen($db_port) == 0) {
|
||||
//leave out port if it is empty
|
||||
if (strlen($db_create_username) == 0) {
|
||||
$db_dest = new PDO("mysql:host=$db_host;", $db_username, $db_password);
|
||||
$db_dest = new PDO("mysql:host=$db_host;", $db_username, $db_password, array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'));
|
||||
}
|
||||
else {
|
||||
$db_dest = new PDO("mysql:host=$db_host;", $db_create_username, $db_create_password);
|
||||
$db_dest = new PDO("mysql:host=$db_host;", $db_create_username, $db_create_password, array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'));
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (strlen($db_create_username) == 0) {
|
||||
$db_dest = new PDO("mysql:host=$db_host;port=$db_port;", $db_username, $db_password);
|
||||
$db_dest = new PDO("mysql:host=$db_host;port=$db_port;", $db_username, $db_password, array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'));
|
||||
}
|
||||
else {
|
||||
$db_dest = new PDO("mysql:host=$db_host;port=$db_port;", $db_create_username, $db_create_password);
|
||||
$db_dest = new PDO("mysql:host=$db_host;port=$db_port;", $db_create_username, $db_create_password, array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user