dougengqiu8031 2018-09-17 16:47 采纳率: 100%
浏览 187
已采纳

未捕获的ArgumentCountError:函数wpdb :: prepare():update的参数太少

I am getting the following error :

Fatal error: Uncaught ArgumentCountError: Too few arguments to function wpdb::prepare(), 1 passed in /homepages/39/d740877019/htdocs/test/wp-content/themes/eduma/formulaire_get.php on line 108 and exactly 2 expected in /homepages/39/d740877019/htdocs/test/wp-includes/wp-db.php:1222 Stack trace: #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): require_once('/homepages/39/d...') #2 /homepages/39/d740877019/htdocs/test/wp-content/themes/eduma/wrapper.php(14): load_template('/homepages/39/d...') #3 /homepages/39/d740877019/htdocs/test/wp-includes/template-loader.php(74): include('/homepages/39/d...') #4 /homepages/39/d740877019/htdocs/test/wp-blog-header.php(19): require_once('/homepages/39/d...') #5 /homepages/39/d740877019/htdocs/test/index.php(17): require('/homepages/39/d...') #6 {main} thrown in /homepages/39/d740877019/htdocs/test/wp-includes/wp-db.php on line 1222

The line in question is the second one below :

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

1条回答 默认 最新

  • douruhu4282 2018-09-17 17:07
    关注

    i resolve my probleme :

    $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'));
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 maple软件,用solve求反函数出现rootof,怎么办?
  • ¥50 汇编语言除法溢出问题
  • ¥15 Visual Studio问题
  • ¥15 state显示变量是字符串形式,但是仍然红色,无法引用,并显示类型不匹配
  • ¥20 求一个html代码,有偿
  • ¥100 关于使用MATLAB中copularnd函数的问题
  • ¥20 在虚拟机的pycharm上
  • ¥15 jupyterthemes 设置完毕后没有效果
  • ¥15 matlab图像高斯低通滤波
  • ¥15 针对曲面部件的制孔路径规划,大家有什么思路吗