我正在制作一个IS,我有一个更新mysql表的问题.我正在使用PHP 5.3和PDO.
$query_update = $this->db_connection->prepare('UPDATE Client SET name =: name, surname=:surname WHERE id=:id'); $query_update->bindValue(':id', $id, PDO::PARAM_INT); $query_update->bindValue(':name', $name, PDO::PARAM_STR); $query_update->bindValue(':surname', $surname, PDO::PARAM_STR); $query_update->execute();
警告:PDOStatement :: execute()[pdostatement.execute]:SQLSTATE [HY093]:参数号无效:绑定变量数与第X行文件中的标记数不匹配.Warning是使用execute()引用行.
感谢帮助.
编辑:它现在正在工作,再次感谢您的帮助.