function delete_hotspot_completed($hotspot_id, $user_id) { global $wpdb; $hotspot_completed_table = get_hotspot_completed_table_name(); $wpdb->delete($hotspot_completed_table, array('hotspot_id' => $hotspot_id, 'user_id' => $user_id)); }
function build_hotspot_completed_sql() { $table_name = get_hotspot_completed_table_name(); $user_table = get_user_table_name(); $sql = "CREATE TABLE {$table_name} (\n `hotspot_id` int(11) unsigned NOT NULL,\n `user_id` bigint(20) unsigned NOT NULL,\n PRIMARY KEY(`hotspot_id`, `user_id`),\n FOREIGN KEY(`user_id`) REFERENCES {$user_table}(`ID`)\n );"; return $sql; }