Hi guys,
I am trying to execute a query which takes one input value and returns 2 columns in the result.
Not sure where i am making the mistake, cos it is not returning any result. I think i am a little confused with the passing the value to the query and then reading the result.
Any help will be greatly appreciated.
Thank you
#--------CODE--------------------
my $select_dbh = DBI->connect("DBI:mysql:$db_chip;host=$host",$user, $password) or die "Can't connect to MySQL database: $DBI::\
errstr\n";
my $select_sql = qq{ SELECT sampleid, chipid FROM new_pedpath where sampleid=?};
my $select_sth = $select_dbh->prepare($select_sql);
my @vals=();
my($subid, $chp);
foreach my $sid(sort keys %pft_list)
{
if($pft_list{$sid} eq "no"){
eval {
$select_sth->bind_param( 1, $sid, SQL_INTEGER);
$select_sth->execute();
#$select_sth->bind_columns(\$subid, $chp);
while(@vals=$select_sth->fetch()){
print "@vals\n";<STDIN>;
}
}
}
}
------------------------------------------