I have to insert a text value, a date and an enum, example:
email -> varchar(256),
date -> datetime,
subscribed -> enum('yes', 'no')
I've written the code bellow, but I'm not really sure what's the correct way of inserting, like the formats, is datetime a string or not, etc. I don't get any error in wordpress so it's kinda hard for me to tell where I am wrong.
if(isset($_POST['newsletter_submit'])) {
$email = $_POST['email'];
$sql = $wpdb->prepare(
"INSERT INTO `wp_newsletter` (`email`,`date`, 'subscribed') values (%s,%s,%s)",
$email, current_time('mysql'), 'yes');
$wpdb->query($sql);
}