How can I make a text link to delete rows in two tables? I want it to work the same way as the red "x" in phpMyAdmin. One row would be in wp_posts, the other in a non-standard table.
Any insight?
How can I make a text link to delete rows in two tables? I want it to work the same way as the red "x" in phpMyAdmin. One row would be in wp_posts, the other in a non-standard table.
Any insight?
Can't help you with the non-standard table...
You can make a button to delete rows on the front end...
Put this in your page template...I made a new template to show/deal with tables.
<a href="">
<input type="submit" name="Whitetemp" value=" Delete Data " onclick="<?php delete_data_func(); ?>" />
</a>
Then make a function to delete your row in your table either in your functions.php or in a plugin
function delete_data_func() {
global $wpdb;
$wpdb->query(" DELETE FROM your_table_name WHERE ID = '1' ");
}
WHERE ID is the row/entry's ID that you want to delete
This topic has been closed to new replies.