This is the query of the database:
This follows:Select * from messages where (username='$username' or toname='$usernam +e') and message!='' order by dateadded desc, ID desc
I try to only print 10 records per page. It works perfectly for the first page, but when I come back to print the second page it duplicates some threadIDs because they are not yet in the $threadIDlist var. The second page is called with this query_string:$titlesperpage = 10; $currentpage = 1; $startcount = ($currentpage - 1) * $titlesperpage + 1; $stopcount = $currentpage * $titlesperpage; $current_count = 0; $threadcount=0; $threadIDlist = ""; while ($pointer3 = $sth3->fetchrow_hashref){ $current_count++; $threadID = $pointer3->{'threadID'}; $threads{$pointer3->{'threadID'}}++; if ($threadIDlist !~ /$threadID/) { $threadIDlist=$threadID . "," . $threadIDlist; $current_count--; $threadcount++; } }
?currentpage=2
In reply to Re^2: Counting fields from database (updated)
by htmanning
in thread Counting fields from database
by htmanning
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |