venkatpavan
Programmer
Hi,
Could someone help me on how to get the values from sql query,Below is the query i'm using to get 3 values and trying to use later but I'm getting only one value from the query,Below is the query which I'm using in my script.
$sql = qq {SELECT FieldA,FieldB,FieldC FROM TABLE Where X=X };
print $sql;
$sth = $dbconnection -> prepare ($sql)
$sth -> execute
$query_results = $sth -> fetchrow();
if ($query_results > 0) {
my @res = $query_results;
if($res[1] == $Value1 and $res[2] == $Value2) {
Value = $res[0]; }
else {
if($res[1] != $Value1){
DO Something;}
else {DO something }
Thanks,
Could someone help me on how to get the values from sql query,Below is the query i'm using to get 3 values and trying to use later but I'm getting only one value from the query,Below is the query which I'm using in my script.
$sql = qq {SELECT FieldA,FieldB,FieldC FROM TABLE Where X=X };
print $sql;
$sth = $dbconnection -> prepare ($sql)
$sth -> execute
$query_results = $sth -> fetchrow();
if ($query_results > 0) {
my @res = $query_results;
if($res[1] == $Value1 and $res[2] == $Value2) {
Value = $res[0]; }
else {
if($res[1] != $Value1){
DO Something;}
else {DO something }
Thanks,