【发布时间】:2018-09-09 18:10:30
【问题描述】:
$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() )...
结果:一般错误:25 绑定或列索引超出范围
什么是问题?谢谢!
【问题讨论】:
-
您不能一次执行多个查询。
-
@u_mulder 我也这么认为,但我发现一些信息说你可以,比如stackoverflow.com/questions/6346674/…
-
@Barmar 很有趣。那么问题应该是重复的
userId占位符。 -
是的,我怀疑就是这样。