Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author codepeople

    (@codepeople)

    Hi,

    If you want to auto-fill your own database table with a different table structure then you can use the action ‘cptslotsb_process_data’ to intercept the submission and get the data:

    add_action( 'cptslotsb_process_data', 'new_appointent', 11, 1 );
    
    function new_appointment($params)
    {
    // do stuff here,
    // $params is an associative array with the booking data
    }

    Thank you for using the plugin!

    Thread Starter Praveeen Sasikumar

    (@praveensasidfan)

    add_action( ‘cptslotsb_process_data’, ‘new_appointent’, 11, 1 );
    function new_appointment($params){
    global $wpdb;
    $wpdb->insert(‘testbookinghook’, array(‘id’ => ’22’));
    // do stuff here,
    // $params is an associative array with the booking data
    }

    This code is not inserting id = 22 into the database table ‘testbookinghook’.
    Can you help me with what is wrong? Can you show some example code?
    Note: the table has only one column with no primary key.

    Thread Starter Praveeen Sasikumar

    (@praveensasidfan)

    Also how to display Booking successful message?

    Plugin Author codepeople

    (@codepeople)

    Hi,

    There may be a query error in that code (ex: missing prefix from table name). Try installing a “query monitor” plugin to easily debug that.

    Use the following settings field to indicate the address of the page that contains teh successful booking message:

    https://wptimeslot.dwbooster.com/images/articles/thank-you-page.png

    Thank you!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Form Action to Database’ is closed to new replies.