PHP PDOStatement :: execute():SQLSTATE [HY093]

问题描述 投票:0回答:1

警告:PDOStatement :: execute():SQLSTATE [HY093]:无效的参数编号:在第14行的C:\ xamppp \ htdocs \ porto \ yonetim \ network \ islem.php中未定义参数

我遇到错误

项目来源:https://www.youtube.com/watch?v=Kwy40bF_0Fg&list=PLZtkgIR0fgTHt1ZaDskLfv3WwVTdCYDIU&index=12

<?php 
ob_start();
include 'baglan.php';
if (isset($_POST['genelayarkaydet'])) {


 $ayarkaydet=$db->prepare("UPDATE ayar SET
ayar_siteurl=:ayar_siteurl,
ayar_title=:title
WHERE ayar_id=0");

 $update = $ayarkaydet -> execute(array(
'siteurl' => $_POST['ayar_siteurl'],
'title' => $_POST['ayar_title']
));

if ($update) {
    echo "Başarılı..";
}


}


 ?>
php mysql pdo execute ob-start
1个回答
0
投票

尝试一下:

$update = $ayarkaydet->execute([
':aray_siteurl' => $_POST['ayar_siteurl'],
':title' => $_POST['ayar_title']]);
© www.soinside.com 2019 - 2024. All rights reserved.