my problem is too complex
now i have files
table
I selected from it the files which added in last seven days. it returns many ids like 1,2,3,4,5 ok it's great. Now the problem:
i have tutorial
table
every tutorial
has some files of files
table
now i selected from files
which last added from 7 days
and make list ordered by files downloaded count desc
and after that I select from tutorial
which equal tutorial id in the files
table
this mean
files_id tutorial_id
1 2
files_id tutorial_id
2 2
this mean two files in one tutorial
now the tutorial
tut_id tut_title
1 tite test
downloaded in last seven days by files list
file_id = 1 this mean tutorial id = 2
file_id = 2 this mean tutorial id = 2
This means I have one tutorial and two files in the most downloaded list will duplicate the tutorial title twice.
its really complex.