Php Sql错误:一般错误:25
结果:一般错误:25绑定或列索引超出范围 什么是问题?谢谢 说明(通过以下方式找到): 输入参数中的键必须与SQL中声明的键匹配。在PHP5.2.0之前,这被默默地忽略了Php Sql错误:一般错误:25,php,sql,sqlite,pdo,Php,Sql,Sqlite,Pdo,结果:一般错误:25绑定或列索引超出范围 什么是问题?谢谢 说明(通过以下方式找到): 输入参数中的键必须与SQL中声明的键匹配。在PHP5.2.0之前,这被默默地忽略了 尝试将查询一分为二,对于每个execute只指定使用的参数?您不能同时执行多个查询。@u\u mulder我也这么认为,但我发现一些信息表明您可以,比如@Barmar interest。那么问题应该是重复的userIdplaceholder。是的,我猜就是这样。 $up = $this->db->prepare (
尝试将查询一分为二,对于每个
execute
只指定使用的参数?您不能同时执行多个查询。@u\u mulder我也这么认为,但我发现一些信息表明您可以,比如@Barmar interest。那么问题应该是重复的userId
placeholder。是的,我猜就是这样。
$up = $this->db->prepare ("
UPDATE ".self::DbUser." SET UserLogin=:UserLogin WHERE UserId=:UserId;
UPDATE ".self::DbUProfile." SET ProfileName=:ProfileName, ProfilePhone=:ProfilePhone WHERE ProfileUserId =:UserId");
$up->bindValue (':UserLogin', $UserLogin);
$up->bindValue (':ProfileName', $ProfileName);
$up->bindValue (':ProfilePhone', $ProfilePhone);
$up->bindValue (':UserId', $UserId);
if ( !$up->execute() )...