<?php 
class qry  extends clsDB{
var 
$result;
var 
$cols;

    function 
qry(&$c){
        
$this->c=$c->c;
        
$this->DB=$c->db;
    }

    function 
query($Sql){
    
//doQuery เป็นฟังก์ชั่นที่รับคำสั่ง Select เพื่อรองรับการ join ตาราง พร้อมทั้งสร้างตัวแปรคลาสตามจำนวนฟิลด์ที่ Select
        
$this->SetQuery($Sql);
        
$this->cols $this->NumField();
        for (
$i=0$i<$this->cols$i++){
            eval(
"\$this->".$this->FieldName($i)."='';");
        }
    }

    function 
GetRecord(){
    
//GetRecord เป็นฟังก์ชั่นนำค่าที่ได้จากการเอ็กซีคิวมากำหนดค่าให้กับตัวแปรของคลาส
        
if($this->result $this->GetResult()){
            for (
$i=0$i<$this->cols$i++){
                eval(
"\$this->".$this->FieldName($i)."=\$this->result['".$this->FieldName($i)."'];");
            }
            return 
1;
        }
        else{
            return 
0;
        }
    }
//class qry
?>