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

  • Creator
    Topic
  • #30835
    Resolved justdoit123
    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

Viewing 1 replies (of 1 total)
  • Author
    Replies
  • #30836
    justdoit123
    Participant

    sorry my mistake, please delete this post

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.