问:
select *
from marrydays
where YMD_X like 2010-1-%
and marrydays.CONG not like aa%
and marrydays.CONG not like bb% ;
但是,在我使用我的sql_fetch_object功能之后, 我没有得出确切的结果,结果就象我问的那样:
select * from marrydays where YMD_X like 2010-1-% ;
为什么?
一些法典:
1美元=db->find("select * from marriagesdays where YMD_X as.” “.$cnD% and CONG not similar ́$male_shu% ;”
public function find($sql, $key=null){ $data = array(); $result = $this->query($sql); while($row = mysql_fetch_object($result)){ if(!empty($key)){ $data[$row->{$key}] = $row; }else{ $data[] = $row; } } return $data; }
public function query($sql){
$stime = microtime(true);
$result = mysql_query($sql, $this->conn);
$this->query_count ++;
if($result === false){
throw new Exception(mysql_error($this->conn)." in SQL: $sql");
}
$etime = microtime(true);
$time = number_format(($etime - $stime) * 1000, 2);
$this->query_list[] = $time . . $sql;
return $result;
}