Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/233.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
如何修复:PDOStatement::execute()希望参数1是数组,字符串在第64行的C:\wamp64\www\invoiceTem01-Create.php中给出_Php_Mysql_Insert Update - Fatal编程技术网

如何修复:PDOStatement::execute()希望参数1是数组,字符串在第64行的C:\wamp64\www\invoiceTem01-Create.php中给出

如何修复:PDOStatement::execute()希望参数1是数组,字符串在第64行的C:\wamp64\www\invoiceTem01-Create.php中给出,php,mysql,insert-update,Php,Mysql,Insert Update,您正在使用: 但是,如果要创建新查询或要运行查询而不获取结果,则必须使用: $query1 = "UPDATE invoice_master SET invoice_no='$id/2019/2020' , invoice_name='TEMP01' WHERE $id"; if ($stmt->execute($query1)){ 看起来您将6种不同的方法粘在一起了。您不应该对进入数据库的数据使用htmlspecialchars()。看见 $query1 = "UPDATE i

您正在使用:

但是,如果要创建新查询或要运行查询而不获取结果,则必须使用:

$query1 = "UPDATE invoice_master SET invoice_no='$id/2019/2020' , invoice_name='TEMP01' WHERE $id";
    if ($stmt->execute($query1)){

看起来您将6种不同的方法粘在一起了。您不应该对进入数据库的数据使用
htmlspecialchars()
。看见
$query1 = "UPDATE invoice_master SET invoice_no='$id/2019/2020' , invoice_name='TEMP01' WHERE $id";
    if ($stmt->execute($query1)){
$query1 = "UPDATE invoice_master SET invoice_no='$id/2019/2020' , invoice_name='TEMP01' WHERE $id";
    if ($con->exec($query1)){