$label[] = 'Content';
$label[] = 'Not Content';
$label[] = 'Between';
$label[] = 'Not Between';
$retorno = "<select name=\"select\">\n";
$i=0;
do{
if ($_POST['select'] == $wheres[$i]){
$selected = " selected=\"selected\" ";
}else{
$selected = "";
}
$retorno .= "<option value=\"$wheres[$i]\"$selected>$label[$i]</option>\n";
$i++;
}while($i < count($wheres));
$retorno .= "</select>\n";
return $retorno;
}
function fieldText($size, $max){
$retorno .= "<input type=\"text\" name=\"fieldtext\" size=\"$size\" maxlength=\"$max\"
value=\"$_POST[fieldtext]\" />\n";
return $retorno;
}
/构造条件与变量查询
function wheres($value){
$retorno = "";
//parei aqui
$this->field2 = explode(' OR ',$this->field2);
//var_dump($this->field2);
$i = 0;
switch($value){
case 'equal':
foreach ($this->field2 as $field2){
$retorno .= "$this->field1 = '$field2' ";
$i = ++$i;
if ($i != 0 && $i != count($this->field2)){
$retorno .= " OR ";
}
}
break;