uncaughtArgumentCounterRor:参数太少,无法实现wpdb::prepare():update

uqzxnwby  于 2021-06-21  发布在  Mysql
关注(0)|答案(1)|浏览(366)

我得到以下错误:
致命错误:uncaught argumentcounterror:函数wpdb::prepare()的参数太少,第108行的/homepages/39/d740877019/htdocs/test/wp content/themes/eduma/formulaire\u get.php中有1个通过,而/homepages/39/d740877019/htdocs/test/wp includes/wp db中正好有2个通过。php:1222 stack 跟踪:#0/homepages/39/d740877019/htdocs/test/wp content/themes/eduma/formulaire_get.php(108):wpdb->prepare('update wp_pmpro…')#1/homepages/39/d740877019/htdocs/test/wp includes/template.php(688):需要一次('/homepages/39/d..')2/homepages/39/d740877019/htdocs/test/wp content/themes/eduma/wrapper.php(14):加载模板('/homepages/39/d..')3/homepages/39/d740877019/htdocs/test/wp includes/template loader.php(74):包含('/homepages/39/d..')4/homepages/39/d740877019/htdocs/test/wp blog header.php(19):需要一次('/homepages/39/d..)#5/homepages/39/d740877019/htdocs/test/index.php(17):需要('/homepages/39/d..)#6{main}抛出/homepages/39/d740877019/htdocs/test/wp includes/wp-db.php,第1222行
下面是第二行:

$current_price = (($ecoles * $classes)/10)*28 ; 
$wpdb->query($wpdb->prepare("UPDATE wp_pmpro_membership_levels SET initial_payment='".$current_price."' WHERE name = mairie"));
k3bvogb1

k3bvogb11#

我解决了我的问题:

$current_price = (($ecoles * $classes)/10)*28 ; 
$wpdb->query($wpdb->prepare("UPDATE wp_pmpro_membership_levels 
                SET initial_payment='%s' 
                WHERE name = %s",$current_price,'mairie'));

相关问题