the environmental background of the problems and what methods you have tried
related codes
/ / Please paste the code text below (do not replace the code with pictures)
first picture code
public function edit () {
$db_01=new DB();
$id_edit=Request::instance()->param("id");
$m=$db_01::table("caipin")->where("id",$id_edit)->select();
$this->assign("m",$m);
return view();
}
second picture code
< form action= "{: url ("Guanli/tz")}" method= "POST" >
{volist name="m" id="vo_edit"}
<text style="font-size: 15px;" type="" name="id" value="">{$vo_edit.id} </text><br>
<input type="" name="name" value="{$vo_edit.cp_name}"><br>
<input type="" name="price" value="{$vo_edit.cp_price}"><br>
<input type="" name="kind" value="{$vo_edit.cp_kind}"><br>
<input type="submit" name="" value=""><br>
{/volist}
</form>
figure 3 Code
public function tz(){
if(request()->isPost()){
$data=[
"id"=>input("id"),// idIDname
"cp_name"=>input("name"),//form
"cp_price"=>input("price"),
"cp_kind"=>input("kind"),
];
var_dump($data);
$db=new DB();
if($db::table("caipin")->update($data)){ //
return $this->success(""); // lst
}
else{
return $this->error("");
}
}
}
what result do you expect? What is the error message actually seen?
Why is the data passed but cannot be updated to the database