Can't make WordPress save in custom table

Support MB Custom Table Can't make WordPress save in custom tableResolved

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #14118
    kesitkesit
    Participant

    Hi,
    I have this MB Custom Table ver. 1.1.8.
    My custom table successfully created but when I save my custom post type with custom table, it won't save in custom table and still save data in usual table.

    Here is my code to create the table:

    add_action( 'init', 'prefix_create_table' );
    function prefix_create_table() {
        if ( ! class_exists( 'MB_Custom_Table_API' ) ) {
            return;
        }
        MB_Custom_Table_API::create( 'xxx_table', array(
                    'konsumen_capsule_id' => 'VARCHAR(20) NOT NULL',
                    'konsumen_prod_pref' => 'TEXT NOT NULL',
                    'konsumen_capsule_1_taste'  => 'TEXT NOT NULL',
                    'konsumen_capsule_1_sensation' => 'TEXT NOT NULL',
                    'konsumen_capsule_1_intent' => 'TEXT NOT NULL',
                    'konsumen_capsule_1_adoptability' => 'TEXT NOT NULL',
                    'konsumen_capsule_2_taste' => 'TEXT NOT NULL',
                    'konsumen_capsule_2_sensation' => 'TEXT NOT NULL',
                    'konsumen_capsule_2_intent' => 'TEXT NOT NULL',
                    'konsumen_capsule_2_adoptability' => 'TEXT NOT NULL',
                    'konsumen_capsule_3_taste' => 'TEXT NOT NULL',
                    'konsumen_capsule_3_sensation' => 'TEXT NOT NULL',
                    'konsumen_capsule_3_intent' => 'TEXT NOT NULL',
                    'konsumen_capsule_3_adoptability' => 'TEXT NOT NULL',
        ));
    }

    and here's the code to create the metabox:

    https://ghostbin.com/paste/m938q

    Would you mind to point me to a clue to fix this?

    Thanks a lot!

    #14131
    kesitkesit
    Participant

    Sorry, the above meta box is: https://ghostbin.com/paste/xsoa7

    #14134
    Anh TranAnh Tran
    Keymaster

    Hi kesit,

    Please make sure all field IDs match the table columns. I see at lease konsumen_id field doesn't have a column in the table.

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