My table name is pm. I have two questions.
How can I check if new rows is insert this table(using wpdb query)?
How to get the inserted rows from table (using wpdb query)?
$wpdb->insert('table', $arrayData);
this will return true if it successfully added to your table and false if failed to add to table due to some error in query
to get the last inserted record id you can use
$wpdb->insert_id
which will return last record's id
more details on $wpdb is here https://codex.wordpress.org/Class_Reference/wpdb#INSERT_row
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments