Hi guys,
Basically I want to clear all data within a table (which I’ve created, it’s a caching table), but I’m having trouble deleting the data in the table. Here’s the function that runs when the required button is pressed in the back end:-
function wp_email_capture_truncate()
{
global $wpdb;
$table_name = $wpdb->prefix . "wp_email_capture_temp_members";
$sql = "TRUNCATE " . $table_name;
$result = $wpdb->query($wpdb->prepare($sql));
}
Does wpdb allow the TRUNCATE FUNCTION? Or am I doing something really really stupid?
Thanks!