global $wpdb;
$table_name = 'xxx';
$wpdb->query( "INSERT INTO $table_name (description,status) VALUES ('字段内容','字段内容')" );
$ID = $wpdb->insert_id;
global $wpdb;
$table_name = 'xxx';
$wpdb->query( "INSERT INTO $table_name (description,status) VALUES ('字段内容','字段内容')" );
$ID = $wpdb->insert_id;
本文标题:wordpress插入数据库并返回主键(新增数据)
本文链接:https://www.haomeiwen.com/subject/tzabnhtx.html
网友评论