in reply to Re^2: Help my syntax
in thread Help my syntax

That line should be:

my $sql = "SELECT * FROM final WHERE pat = ? and ped = ?";

The second WHERE is an error, per my reading of the MySQL documentation.