Jump to content
Дизайн и модификация IPS Community IPBSkinsBETA
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
fluoro

Выборка контента за определенное число

Recommended Posts

Можно ли, допустим, сделать выборку прикрепленных файлов за определенный промежуток времени? В определенной теме или форуме?

Share this post


Link to post
Share on other sites

Странный вопрос. Конечно, можно. Таблицы все в БД и никуда не прячутся. Выбирай - не хочу :)

 

SELECT a.* , p.*
FROM attachments a
LEFT JOIN posts p ON p.pid = a.attach_rel_id
WHERE a.attach_rel_module = 'post'
AND p.topic_id = %ID_ТОПИКА%

 

SELECT a.* , p.*
FROM attachments a
LEFT JOIN posts p ON p.pid = a.attach_rel_id
LEFT JOIN topics t ON t.tid = p.topic_id
WHERE a.attach_rel_module = 'post'
AND t.forum_id = %ID_ФОРУМА%

  • Upvote 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...