User posts export as csv or text

Including t.user_id would only give posts where the user was also the OP. Could that be the main issue?

I noticed a couple of extra bits that may be useful too. Something like:

-- [params]
-- user_id :user

SELECT t.id AS topic_id, 
       t.title, 
       p.raw as text, 
       p.created_at as dateposted
FROM posts p
JOIN topics t ON t.id = p.topic_id
WHERE t.archetype != 'private_message'
  AND p.post_type IN (1, 4)
  AND p.user_id = :user
  AND t.deleted_at ISNULL
  AND p.deleted_at ISNULL
ORDER BY p.created_at
1 Like