comment_post
hook pass to attached functions 3 parameters. The fourth parameter of add_action()
indicates to how many parameters the attached function will be able to access.
add_action( 'comment_post', 'save_chbox_in_db', 10, 3 );
function save_chbox_in_db( $comment_ID, $comment_approved, $commentdata )
{
$post_id = (int)$commentdata['comment_post_ID'];
//
// other code
//
}