I've used wp_send_json() to send the currently posted form data but cannot find a way to send the id attached to it which is incremented automatically from the database,, so that i can update the table data on the page without refreshing...
I've used wp_send_json() to send the currently posted form data but cannot find a way to send the id attached to it which is incremented automatically from the database,, so that i can update the table data on the page without refreshing...
Share Improve this question asked May 15, 2019 at 17:07 Bikash GurungBikash Gurung 213 bronze badges1 Answer
Reset to default 0From an example in the Developer Reference:
To get the id of the inserted object use
$wpdb->insert_id;
global $wpdb; $table = $wpdb->prefix.'you_table_name'; $data = array('column1' => 'data one', 'column2' => 123); $format = array('%s','%d'); $wpdb->insert($table,$data,$format); $my_id = $wpdb->insert_id;
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745490264a4629956.html
评论列表(0条)