Page 1 of 1

How can I make this faster?

Posted: Sun Oct 13, 2002 10:52 am
by akkassia
I kind of made a simple version of forum.

And, to divide the lists into many pages I used

Code: Select all

<?php

$page_no = 15; // 15 per page

$query_data = mysql_query("select * from j_$j order by no desc limit $f_article,$page_no", $connect);

while($data = mysql_fetch_array($query)) {
.
.
.
}

?>
And, I've done a test with 100000 articles.

And, when I go to my last page, it gets so slow.

I think it's because at the last page, $f_article value is so big that it takes quite a long time for the mysql to do its job.

I would like to know how you can overcome this.

I think the problem is with the algorism.

Is there a different way to do this?

How do you take care of these problems?

Posted: Sun Oct 13, 2002 11:50 am
by volka
do you have an index on no in your db? is it the primary index?