mysql操作类(4)
来源:未知 责任编辑:责任编辑 发表时间:2015-10-08 14:15 点击:次
}else {
return mysql_fetch_array($this->result);
}
}
//取得结果数 $row['content']
public function mysql_result_li(){
return mysql_result($str);
}
//获取关联数组 $row['字段名']
public function fetch_assoc(){
return mysql_fetch_assoc($this->result);
}
//获取数字索引数组 $row[0] $row[1] $row[2]
public function fetch_row(){
return mysql_fetch_row($this->result);
}
//获取对象数组,使用$row->content
public function fetch_Object(){
return mysql_fetch_object($this->result);
}
//简化查询select
public function findall($table){
$this->query("select* from $table");
}
//简化查询select
public function select($table,$columnName="*",$condition='',$debug=''){
$condition=$condition?'where'.$condition:null;
if($debug){
echo "select $columnName from $table $condition";
}else{
$this->query("select $columnName from $table $condition");
}
}
//简化删除del
public function delete($table,$condition,$url=''){
if($this->query("delete from $table where $condition")){
if(!emptyempty($url)){
$this->Get_admin_msg($url,'删除成功');
相关新闻>>
- 发表评论
-
- 最新评论 更多>>