Title: recemet comments SQL
Last modified: August 19, 2016

---

# recemet comments SQL

 *  [Rami Yushuvaev](https://wordpress.org/support/users/ramiy/)
 * (@ramiy)
 * [17 years, 2 months ago](https://wordpress.org/support/topic/recemet-comments-sql/)
 * when i try:
 * >  $request = “SELECT ID, comment_ID, comment_content, comment_author, comment_author_url,
   > post_title
   >  FROM $wpdb->comments AS cm, $wpdb->posts AS ps WHERE ps.ID=cm.comment_post_ID
   > AND post_status IN (‘publish’,’static’) “;
 * every thing is ok. but when i want to get the “user_login” from the wp_users 
   table using this code:
 * >  $request = “SELECT ID, comment_ID, comment_content, comment_author, comment_author_url,
   > post_title, user_login
   >  FROM $wpdb->comments AS cm, $wpdb->posts AS ps, $wpdb-
   > >users AS us WHERE ps.ID=cm.comment_post_ID AND us.ID=cm.user_id AND post_status
   > IN (‘publish’,’static’) “;
 * the sql find no results. what am i doing wrong?

The topic ‘recemet comments SQL’ is closed to new replies.

## Tags

 * [Comments](https://wordpress.org/support/topic-tag/comments/)
 * [sql](https://wordpress.org/support/topic-tag/sql/)
 * [users](https://wordpress.org/support/topic-tag/users/)

 * 0 replies
 * 1 participant
 * Last reply from: [Rami Yushuvaev](https://wordpress.org/support/users/ramiy/)
 * Last activity: [17 years, 2 months ago](https://wordpress.org/support/topic/recemet-comments-sql/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
