Wordpress Plugin Question: Having problems with comment_author_email

function remove_comments_left($comment_author_email)  {
	global $wpdb;
	global $default_comments_allowed;
	$table_name = $wpdb->prefix . "gatornet";
	$wpdb->query("INSERT INTO ".$table_name." (email, comments_left) VALUES ('".$comment_author_email."', '".$default_comments_allowed."' )");
}

add_action('comment_post', 'remove_comments_left');

Above is the code I am using to try to submit the email of anyone who submits a comment into a database table. However, the odd thing that happens is that instead of putting in the authors email address it is putting “2010”, “2011”, “2012”, and so on into table where the email address should go. I’m not trying to pull a date of any kind as you can see based on the function above. Any ideas what i’m doing wrong or how I can accomplish what I am attempting to do?

Thanks!

Trace back the variable and make sure it’s an actual comment and not the date… just put “print($comment);” somewhere in your code and see what it says.

If that doesn’t work you probably have the wrong data type setup in the database. Be sure that’s a text data type and not a date/time data type.