ok. I am a decent perl programmer (I think) and I have finished my application and everything works except for ONE issue and I am about to rip my hair out over it so I am asking for some help. I've been staring at this for a long time so maybe I'm just too close to the problem and I can't see it.
So I have a block of code and it executes as it should
I get to the select_item subroutine just fine but in this subroutine, it is getting locked up on the $sth->execute($id). In fact if I just hard code in an id and make
it still doesn't work
it just gets stuck and never does anything
any ideas -- I am open to any comments -- THANK YOU in advance!
So I have a block of code and it executes as it should
Code:
elsif ($beginning eq "edit")
{
my $edititem = $q->param("id");
if (my $row = select_item ($dbh, $edititem))
{
display_edit_form ($row);
}
else
{
print "<FONT FACE='Arial' SIZE=2>No record with that ID was found";
display_current_items_print ($dbh);
}
}
I get to the select_item subroutine just fine but in this subroutine, it is getting locked up on the $sth->execute($id). In fact if I just hard code in an id and make
Code:
my $sql = qq{ SELECT * FROM export WHERE id = 36};
it still doesn't work
it just gets stuck and never does anything
any ideas -- I am open to any comments -- THANK YOU in advance!
Code:
sub select_item
{
my ($dbh, $id) = @_;
my ($sth, $row);
my $sql = qq{ SELECT * FROM export WHERE id = ?};
$sth = $dbh->prepare ( $sql ) or die $dbh->errstr;
$sth->execute($id) or die $dbh->errstr;
$row = $sth->fetchrow_hashref();
$sth->finish();
return ($row);
}