my $ST = $DB->prepare("select foo, bar from my_table " ."where col1 < '$abc' or (col1 > '$def' and col3 < $fgh)"); $ST->execute(); #### my $ST = $DB->prepare("select foo, bar from table where col1 < ? or (col1 > ? and col3 < ?)"); $ST->execute($abc, $def, $fgh); #### select foo, bar from my_table where col1 < ''; drop table my_table ; --' or (col1 > 'def_val' and col3 < fgh_val)