So I'm updating the code of an old wordpress plugin(never released), and I want the database to be "clean" before importing new data otherwise data will just add up and i want it clean before every import, so that duplicates dont happen.
This is the code that i'm using but doesn't seem to work.
global $wpdb; $wpdb->delete( $wpdb->postmeta WHERE meta_key LIKE '_cb_%' ) ); $wpdb->delete( $wpdb->posts WHERE post_type LIKE 'webcam' ) );
What's wrong with this picture?
Thanks in advance.