problem in querry

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • archulu
    New Member
    • Mar 2007
    • 34

    problem in querry

    hai this archulu, i have a doubt in Mod perl programing with pgsql; plz help to me
    in my project i am canducting exam to students, in exam result , 1=right anwer, 0=wrong answer.

    $id=4;
    $sth1=$dbh->prepare("selec t SUM(result) from result_master where exam_id = '$id' and result = '1' ") or warn "Erron in prepare statemt ".$dbh->errstr;
    $res=$sth1->execute();
    in this program result $res prints the value is 1 insted of actuall sum value(suppose 80 etc). plz help to me. what fault in quarry.
    iam also using count insted of SUM. this same qurry working in database but not in program printing
    thanks again
Working...