dongsuoxi1790 2015-10-03 06:59
浏览 49

致命错误在非对象上调用成员函数insert()

I am trying to insert data using ajax in WordPress.But I am getting error below is my code in the file which I have called using ajax:

global $wpdb;
                     $wpdb->insert('design_information',  
                      array( 
                      'layout' => $_SESSION['layout'], 
                      'language' => $_SESSION['briefform_language'], 
                      'logo_name' => $_SESSION['briefform_businessName_validation'] ,
                      'org_description' => $_SESSION['briefform_businessPurpose'], 
                      'bussiness_industry' => $_SESSION['briefform_businessIndustry'] ,
                      'slogan_logo' => $_SESSION['briefform_slogan'], 
                      'payment' => $_SESSION['price'],
                      'others' => $_SESSION['briefform_comments'], 
                      'fullname' => $_POST['paymentform_contactDetails_fullName'] ,
                      'company_name' => $_POST['paymentform_contactDetails_companyName'], 
                      'coutry_code' => $_POST['paymentform_contactDetails_phoneCountry'] ,
                      'payment_status' => 'pending',
                      'color_picker' => $newValue1,
                      'phone_no' => $_POST['paymentform_contactDetails_phoneNumber'], 
                              'address1' => $_POST['paymentform_billingDetails_address1'] , 
                      'address2' => $_POST['paymentform_billingDetails_address2'] ,
                      'city' => $_POST['paymentform_billingDetails_city'],
                      'zip' => $_POST['paymentform_billingDetails_zip'],
                      'state' => $_POST['paymentform_billingDetails_state'], 
                              'country' => $_POST['paymentform_billingDetails_country'],
                              'design' => $newValue, 
                              'slider' => $slider_value, 
                              'Website Address' => $_SESSION['website address'], 
                              'style' => $_SESSION['style'], 
                              'like' => $_SESSION['like'],
                              'file' => $_SESSION['file'], 
                              'email' => $_SESSION['email'],  
                              'order_status' => "pending"
               ));   
  • 写回答

2条回答 默认 最新

  • dou47732 2015-10-03 07:05
    关注

    Um, it's weird, maybe the php thinks that variable hasn't been declared or is not an instance:

    Try this:

    include_once('wp-includes/wp-db.php');
    
    global $wpdb;
    $wpdb->insert('design_information',  ...
    
    评论

报告相同问题?

悬赏问题

  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本