in reply to select from mysql table based on two column match
something like this?
my $sth = $dbh->prepare('SELECT * FROM charge WHERE cpt = ? AND col2 = + ? ') or die "Couldn't prepare statement: " . $dbh->errstr; print "Enter cpt code> "; my $cptcode = <>; chomp $cptcode; if ( defined $cptcode && $cptcode ne '') { print "Enter col2 code> "; my $col2 = <>; chomp $col2; if (defined $col2 && $col2 ne '') { $sth->execute($cptcode,$col2) # Execute the query or die "Couldn't execute statement: " . $sth-> +errstr; .... } # col2 } # cpt
|
|---|