Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- 1. Install the [Database Browser](https://wordpress.org/plugins/database-browser/) plugin
- -- 2. Go to the "Tools > Database Browser" page
- -- 3. Click the "Select table" button (it doesn’t matter which table is selected)
- -- 4. Copy the table prefix of your tables (for example, if the table is `wp_posts`, the prefix is the first part with the underscore `wp_`).
- -- 4. Click the "Edit query" button
- -- 5. Paste the SQL query, replacing every instance of `wp_` in the SQL query with your table prefix.
- -- 6. Click the "Run query" button
- -- 7. Click the "CSV" button to download the results
- SELECT
- p.post_date AS date,
- p.post_date_gmt AS date_gmt,
- p.post_title AS title,
- p.post_content AS content,
- r.rating,
- r.name,
- r.email,
- r.avatar,
- r.ip_address,
- r.is_approved,
- r.is_pinned,
- r.terms,
- GROUP_CONCAT(DISTINCT apt.post_id) AS assigned_posts,
- GROUP_CONCAT(DISTINCT att.term_id) AS assigned_terms,
- GROUP_CONCAT(DISTINCT aut.user_id) AS assigned_users
- FROM wp_glsr_ratings AS r
- INNER JOIN wp_posts AS p ON r.review_id = p.ID
- LEFT JOIN wp_glsr_assigned_posts AS apt ON r.ID = apt.rating_id
- LEFT JOIN wp_glsr_assigned_terms AS att ON r.ID = att.rating_id
- LEFT JOIN wp_glsr_assigned_users AS aut ON r.ID = aut.rating_id
- WHERE p.post_type = 'site-review'
- AND p.post_status IN ('publish','pending')
- GROUP BY r.ID
Add Comment
Please, Sign In to add comment