Wordpress Plugin Help - comment_author_email

PHPGator

New member
Sep 23, 2009
429
3
0
Oklahoma, USA
www.phpgator.com
Code:
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!
 


Figured it out, I thought it was the date, but $comment_author_email is being pulled in as the Comment ID. It just so happens I have enough comments on the site that it matches 2008, 2009, 2010, 2011, etc... I thought it was pulling in a year of some kind. :D