Hello, My article directory runs on a php script and I have a problem with the "Most popular article" page. It should generate the 100 most requested articles but instead it generates a list of every article on database in decending popularity. As there about 250K articles, this is a huge list and takes a long time to be displayed. I've attached the php file for this page, can anyone see the fault?
You need to check the other files. The one which has the sql query. This page does not have any query.
I couldn't open the file for some reason, but i'll just go ahead and believe the poster above me. Find the query and add LIMIT 100
Hello, May sound like a silly question but how would I know where the query is? Would the file with the query in be referenced in this file then I could post the query?
do you have a file called functions or settings or something like that? Can you post the codes before your head tag of Most popular article.php
I think i've found it there's a file called queries.php, too big to post but I found this Would you think is it? where would I add the limit tag?
at the very end $sql="SELECT C.category_description,C.category_name,A.article_title,A.article_author,A.article_snippet,A.article_category_id,A.article_id,A.article_views FROM article_master A,category_master C where A.article_category_id=C.category_id and C.category_status=1 and A.article_status=1 and A.article_views >0 order by A.article_views desc LIMIT 100";
Thank you, That works perfectly after inserting LIMIT, I reduced to top 50 articles and page now opens without waiting two years. Thanks for everyones help