Bladeren bron

utf8 for mysql

master
Pascal Gloor 5 jaren geleden
bovenliggende
commit
cb04c4c7ee
2 gewijzigde bestanden met toevoegingen van 4 en 2 verwijderingen
  1. 2
    1
      bin/autodoc_process.pl
  2. 2
    1
      cgi/autodoc.fcgi

+ 2
- 1
bin/autodoc_process.pl Bestand weergeven

@@ -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;

+ 2
- 1
cgi/autodoc.fcgi Bestand weergeven

@@ -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;

Laden…
Annuleren
Opslaan