update()部分出错代码
$str="";//防止出现$str未定义
foreach ($array as $key=>$val){
if($val==null){
$sep="";
}else{
$sep=",";
}
$str.=$key."='".$val."'".$sep;//注意字符拼接顺序,老师此处有误
}
$str=rtrim($str,",");//去掉最后一个多余","
$str="";//防止出现$str未定义
foreach ($array as $key=>$val){
if($val==null){
$sep="";
}else{
$sep=",";
}
$str.=$key."='".$val."'".$sep;//注意字符拼接顺序,老师此处有误
}
$str=rtrim($str,",");//去掉最后一个多余","
2016-08-25
if(update("imooc_admin", $arr,"id='{$id}'"))如果遇见怎么修改都失败在id=那边加个单引号
2016-08-25