background image

        $host = host; 
        $result = $this->queryRow($query); 
        $row = $result->fetch(PDO::FETCH_ASSOC); 
        $this->close($this->connection); 
        $this->query = $query; 
        return $row; 
        } 
//结束连接

//显示数据字段内容
function fieldSelect(){     
    $query = $this->queryRow('SHOW FULL COLUMNS FROM '.$this->table); 
    $retorno  = "<select name=\"fieldselect\">\n"; 
    foreach ($query as $collums){ 
    if ($_POST['fieldselect'] == $collums['Field']){ 
                $selected = " selected=\"selected\" "; 
    }else{ 
                $selected = "";         
    } 
    $retorno .= "<option value=\"$collums[Field]\"$selected>$collums[Field]</option>\n"; 
    } 
    $retorno .= "</select>\n"; 
    return $retorno;     

//

 

构造查询条件

function whereSelect(){ 
    $wheres = array(); 
    $wheres[] = 'equal'; 
    $wheres[] = 'diferent'; 
    $wheres[] = 'minor'; 
    $wheres[] = 'more'; 
    $wheres[] = 'minororequal'; 
    $wheres[] = 'moreorequal'; 
    $wheres[] = 'content'; 
    $wheres[] = 'notcontent'; 
    $wheres[] = 'between'; 
    $wheres[] = 'notbetween'; 
     
    $label[] = 'Equal'; 
    $label[] = 'Diferent'; 
    $label[] = 'Minor'; 
    $label[] = 'More'; 
    $label[] = 'Minor or Equal'; 
    $label[] = 'More or Equal';