or download this
my $weight = 4;
my $query_submitted = 'SELECT * FROM rates WHERE weight = ?';
...
# This executes the query
my $sth_submitted = $dbh->prepare($query_submitted) or die "Error prep
+are";
$sth_submitted->execute($weight) or die 'Error';