Thread Entry macht Umlaute zu Hex??? (19 answers)
Opened by Gast at 2005-07-20 16:51

Gast Gast
 2005-07-20 17:58
#44218 #44218
Ok wenn das so ist wie bekomme ich das weg?

Wer es nicht glaubt, hab das script noch etwas angepasst. Datenbankdaten müssten halt noch angepasst werden.
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
use Tk;
use DBI;
use Data::Dumper;

$mw = new MainWindow;
my $host='127.0.0.1';
my $user = 'joe';
my $passwd = '';
my $db = 'test_bank';

foreach (qw/Vorname/) {
$mw->Label(-text => $_)->pack();
$mw->Entry(-textvariable => \$results{$_})->pack();
}
$mw->Button(-text => "Ok",
-command => sub {

print Dumper %results;

print $results{Vorname};
$dbh = DBI->connect("DBI:mysql:database=$db;host=$host", $user, $passwd, {'RaiseError' => 1}) or die 'Fehler beim Verbinden!';
$sth = $dbh->prepare(qq[INSERT INTO inhalt ( `id` , `name` ) VALUES ('', '$results{Vorname}')]);



$sth->execute;
} )->pack();
$mw->Button(-text => "Exit", -command => sub { exit } )->pack();

MainLoop();


Dump

CREATE TABLE `inhalt` (
`id` int(11) NOT NULL auto_increment,
`name` text NOT NULL,
PRIMARY KEY (`id`)
) TYPE=MyISAM AUTO_INCREMENT=1 ;

Ich sitzt jetzt schon 4 Stunden an dem Problem und komm einfach nicht weiter..

View full thread Entry macht Umlaute zu Hex???