almost correct

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

With this way since is more straighforward and less lines of code: Now
the code is like this:

#=======================LOADING THE .TXT TO THE DATABASE==============

my $replace = $dbh->prepare( "REPLACE INTO games (gamename, gamedesc,
+gamecounter) VALUES (?, ?, ?)" );

open (FILE, "<../data/games/descriptions.txt") or die $!;

while (<FILE>) {

     if (length) {
        $replace->execute( split(/\t/, $_, 2),  0 ) or print $dbh->errs

close (FILE);

But the records never get updated and if i delete a row on the txt file
but the insertion of a new row or an edit of an existing one work ok :-)

Re: almost correct

In the top of my script i have

my $gamename = param('gamename');


print start_form(-action=>'');
     print table( );
         while( $row = $sth->fetchrow_hashref )
             print Tr(
                      td( ,  submit( $row-> )),
                      td( ,  $row->         ),
                      td( ,   $row->      )
     print end_table;
print end_form;

This is where the submit button is created and this is where i check if
the user click on a game

if( param('gamename') )

but it never returns true! Do you think there is a confilct with the
gamesnname as i have it in the submit button and expect the user to
click on the desired game to download by passign it as a parameter to
the script?

Site Timeline