in reply to Re: select from mysql table based on two column match
in thread select from mysql table based on two column match
"If that is what you are looking for here you go, Untested though!"
Some comments:
#!/usr/bin/perl -w use strict; use warnings;
You have use warnings; and perl -w, both activate warnings.
#Get first input print "Enter cpt code> "; my $cptcode = <STDIN>;
You're not chomping user input.
my $sth = $dbh->prepare('SELECT * FROM charge WHERE column1 = $cptcode + AND column2 = $cpt2code’)
This is dangerous. See SQL_injection/Bobby Tables. Use placeholders and bind variables.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: select from mysql table based on two column match
by afoken (Chancellor) on Jan 26, 2017 at 20:15 UTC |