Cannot use $wpdb insert if remove Custom Field in /edit.php?post_type=meta-box

Support MB Custom Table Cannot use $wpdb insert if remove Custom Field in /edit.php?post_type=meta-boxResolved

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #30835
    justdoit123justdoit123
    Participant

    Hi, my php is limited, i just notice that if i delele Custom Field Group with enabled MB Custom Table in wp-admin/edit.php?post_type=meta-box

    i will cannot use $wpdb->insert to that Custom table wp_test.

    $table = $wpdb->prefix.'test';
            $data_all = array( 'tk_owner' => $user_id,
                            'tk_name' => $tk_name,
                            'tk_email' => $tk_email,
                            'tk_mobile' => $tk_mobile,
                            'tk_address' => $tk_address,
                            'tk_others' => $tk_others,
                            'tk_family' => $tk_family,
                            'tk_family_mobile' => $tk_family_mobile,
                        );
            $format = array('%s','%s');
            $wpdb->insert($table,$data_all,$format);

    If array below 4, wpdb->insert will works:

            $data_all = array( 'tk_owner' => $user_id,
                            'tk_name' => $tk_name,
                            'tk_email' => $tk_email,
                            'tk_mobile' => $tk_mobile,
                        );

    I already generated and added PHP Code to theme functions.php for that custom field group from Metabox

    Any idea why this wpdb->insert cannot insert new row ??
    thanks

    #30836
    justdoit123justdoit123
    Participant

    sorry my mistake, please delete this post

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.