Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > almost correct

Reply
Thread Tools

almost correct

 
 
Nikos
Guest
Posts: n/a
 
      05-12-2005
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>) {
chomp;

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

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
 
Reply With Quote
 
 
 
 
Nikos
Guest
Posts: n/a
 
      05-12-2005
In the top of my games.pl script i have

my $gamename = param('gamename');

and

print start_form(-action=>'games.pl');
print table( {class=>'games'} );
while( $row = $sth->fetchrow_hashref )
{
print Tr(
td( {-width=>'20%'}, submit( $row->{gamename} )),
td( {-width=>'75%'}, $row->{gamedesc} ),
td( {-width=>'5%'}, $row->{gamecounter} )
);
}
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?
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
simulation result is correct but synthesis result is not correct J.Ram VHDL 7 12-03-2008 01:26 PM
Uploaded File Empty but in correct folder with correct name froil Perl Misc 12 03-02-2006 01:21 PM
Correct White Balance Doesn't Mean Correct Color?? jim evans Digital Photography 28 12-27-2005 05:10 AM
correct or not correct? Dan HTML 7 10-02-2003 10:16 PM
To correct my program. please, check to find errors and correct me. joon Java 1 07-08-2003 06:13 AM



Advertisments