> From: Kokarski, Anton [mailto:[EMAIL PROTECTED]]
> 
> my $statement = "select count(*) as viewable from pf_funding where ".
>                    "target_id = ? and amt_allocated > 0.01 
> and year = '" .
> $self->{year} . "'";
> 

Is year always the same value or does it only change once a year? I'd
probably make it a placeholder also either way...

>    if (! defined($sth)) {
>      $sth = $dbh->prepare($statement);
>    }

Do you have RaiseError set?? If there's a prepare error, will you
catch it?

> 
>    $sth->bind_param(1, $trg_id);

> Am at the end of the line here folks and running out of 
> ideas, i even tried
> to do trace but that didn't give me any bigger insight on 
> what is happening
> here.

Assuming RaiseError is on, make sure what's in $trg_id and $self->{year}
is what you think it is (including whitespace).
I've seen cases where newlines in the data caused
differences in results when converting to placeholders.

HTH,
Douglas Wilson

Reply via email to