require 'connect.php';
$linshi = $dbh->prepare('UPDATE `category` SET `name` = :name, `alias`=:alias WHERE `cate_id` = :cate_id ');
if($linshi->execute(['name'=>"999",'alias'=>"8888",'cate_id'=>13])){
if($linshi->rowCount()>0){
echo "ok".$dbh->lastInsertId();
}
}
预处理对象的字段名后面跟着的“预处理变量”,要和字段名一致