Viewing 3 replies - 1 through 3 (of 3 total)
  • You may want to re-phrase it because it doesn’t make sense in its present form…

    related to this, im guessing:

    http://ww.wp.xz.cn/support/topic/158637?replies=3

    you want to know where the sql is that inserts the comment?

    inside wp-includes/comment.php :

    function wp_insert_comment($commentdata) {
    	global $wpdb;
    	extract($commentdata, EXTR_SKIP);
    	if ( ! isset($comment_author_IP) )
    		$comment_author_IP = preg_replace( '/[^0-9., ]/', '',$_SERVER['REMOTE_ADDR'] );
    	if ( ! isset($comment_date) )
    		$comment_date = current_time('mysql');
    	if ( ! isset($comment_date_gmt) )
    		$comment_date_gmt = get_gmt_from_date($comment_date);
    	if ( ! isset($comment_parent) )
    		$comment_parent = 0;
    	if ( ! isset($comment_approved) )
    		$comment_approved = 1;
    	if ( ! isset($user_id) )
    		$user_id = 0;
    	$result = $wpdb->query("INSERT INTO $wpdb->comments
    	(comment_post_ID, comment_author, comment_author_email, comment_author_url, comment_author_IP, comment_date, comment_date_gmt, comment_content, comment_approved, comment_agent, comment_type, comment_parent, user_id)
    	VALUES
    	('$comment_post_ID', '$comment_author', '$comment_author_email', '$comment_author_url', '$comment_author_IP', '$comment_date', '$comment_date_gmt', '$comment_content', '$comment_approved', '$comment_agent', '$comment_type', '$comment_parent', '$user_id')
    	");
    	$id = (int) $wpdb->insert_id;
    	if ( $comment_approved == 1)
    		wp_update_comment_count($comment_post_ID);
    	return $id;}
    Thread Starter t3ch33

    (@t3ch33)

    I found what I was looking for in wp-includes/comment-template.php, but that is helpful, too. Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Where is the comments SQL?’ is closed to new replies.