@@ -3,6 +3,7 @@ | |||
use strict; | |||
use JSON; | |||
use DBI; | |||
use utf8; | |||
use GD::Simple; | |||
use Data::Dumper; | |||
use Data::UUID; | |||
@@ -275,7 +276,7 @@ sub sqlconnect { | |||
my($sql) = @_; | |||
my $dsn = "DBI:mysql:database=$sql->{base};host=$sql->{host}"; | |||
my $dbh = DBI->connect($dsn, $sql->{user}, $sql->{pass}) || \\ | |||
my $dbh = DBI->connect($dsn, $sql->{user}, $sql->{pass}, { mysql_enable_utf8 => 1 }) || \ | |||
die "Failed to connect to database"; | |||
return $dbh; |
@@ -4,6 +4,7 @@ use strict; | |||
use FCGI; | |||
use JSON; | |||
use DBI; | |||
use utf8; | |||
use GD::Simple; | |||
use Data::Dumper; | |||
use Data::UUID; | |||
@@ -510,7 +511,7 @@ sub sqlconnect { | |||
my($sql) = @_; | |||
my $dsn = "DBI:mysql:database=$sql->{base};host=$sql->{host}"; | |||
my $dbh = DBI->connect($dsn, $sql->{user}, $sql->{pass}) || \\ | |||
my $dbh = DBI->connect($dsn, $sql->{user}, $sql->{pass}, { mysql_enable_utf8 => 1 }) || \ | |||
fatal_api_error(500,"Failed to connect to database"); | |||
return $dbh; |