Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/70.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Sql错误:一般错误:25_Php_Sql_Sqlite_Pdo - Fatal编程技术网

Php Sql错误:一般错误:25

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 (

结果:一般错误:25绑定或列索引超出范围

什么是问题?谢谢

说明(通过以下方式找到):

输入参数中的键必须与SQL中声明的键匹配。在PHP5.2.0之前,这被默默地忽略了


尝试将查询一分为二,对于每个
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() )...