$wpdb->insert() is giving error undefined function

后端 未结 3 426
-上瘾入骨i
-上瘾入骨i 2021-01-15 14:51

I have created a new file inside wp-content/theme/mytheme folder.

Inside the file I have written simple query

global $wpdb;
    $insert= $wpdb->i         


        
3条回答
  •  天涯浪人
    2021-01-15 15:23

    According to this document : https://codex.wordpress.org/Class_Reference/wpdb

    you must change your code to this:

    global $wpdb;
    $wpdb->insert(
      'wp_test',
      array(
        'orderID' => $_GET['orderID'],
        'amount' => $_GET['amount'],
        'acceptance' => $_GET['ACCEPTANCE'],
        'status' => $_GET['STATUS'],
      ),
      array( '%d', '%d', '%s','%s' )
    
    );
    

提交回复
热议问题