N
Nikos
Eric said:Your columns are named differently when you create the table and when
you try to populate it (onoma, description, counter in the first case,
and name, description, count in the second). I suspect this might be
relevant.
-=Eric
Just shoot me Eric
You are rigth i changes it back and now the table game shas
smethigncalled <MEMO> in it.
now the scripot is like this( i changes from the beginning all the
columns names to match in greek words)
in games.pl is:
while ( $st->fetchrow_hashref ) {
print table( {class=>'info'},
Tr(
td( submit( -name=>'game', -value=>$_->{onoma} )),
td( $_->{perigrafi} ),
td( $_->{metritis} )
)
)
}
and in make.pl is:
$dbh->do( "create table games( onoma text, perigrafi text, metritis int
)" ) or die $!;
#===============================================================================
my $sth = $dbh->prepare( "INSERT INTO games( onoma, perigrafi, metritis)
VALUES (?, ?, ?)" );
open (FILE, "<../data/games/perigrafes.txt") or die "Can't open FILE: $!\n";
while (<FILE>) {
chomp;
my @row = split /\t/;
my $num = scalar @row;
if ($num == 2)
{
push @row, 0;
unless ( $sth->execute(@row) ) { warn $dbh->errstr; }
if ($dbh->errstr)
{
warn "LINE $.: INSERT '$row[0]': $dbh->errstr\n";
}
}
else
{
warn "Error in line $.: number of fields $num\n";
}
}
close FILE;
#===============================================================================
Iam sorry about my carefullness but i was a bit dizzy trying so many
hours...