public function query($sql,$batch=false){
$data=$batch?$this->data:array($this->data);
$this->data=array();
//通过预处理方式执行SQL
$stmt=$this->db->prepare($sql);
foreach($data as $v){
if($stmt->execute($v)===false){
die("数据库PDO预处理操作失败");
}
}
return $stmt;
}