I am having trouble finding a good resource on using the $wpdb function.
I am trying to delete a row from a custom table named: eLearning_progress
$removefromdb = $wpdb->query("DELETE FROM eLearning_progress WHERE ID = '$user_id' AND module_id = '$singlecomparearrays_remove'" );
The row I would like to delete has the ID of '$user_id' and the 'module_id' of '$singlecomparearrays_remove'.
I have also tried:
$removefromdb = $wpdb->query( "DELETE FROM eLearning_progress WHERE ID = ($user_id) AND module_id = ($singlecomparearrays_remove)" );
and then:
$removefromdb = $wpdb->query($wpdb->prepare("DELETE FROM eLearning_progress WHERE ID = %s AND module_id = %s", $user_id, $singlecomparearrays_remove));
Please try not to sigh too loudly at my attempts but I can't find a good guide on using the DELETE command with variables in there too. Any help is much appreciated.
Regards, Alex
delete()
?