21293 Posts in 5733 Topics by 2602 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 521 Views |
-
pagination query result problem.

13 February 2009 at 8:52pm Last edited: 13 February 2009 10:28pm
Hi!
I write my query in this way.function Conn()
{
global $db_pandora;
$record=$db_pandora->query('SELECT * FROM mm_ville');
$rec=array();
while($rec[]=$record->nextRecord())
{ }$doSet = new DataObjectSet();
foreach($rec as $key)
{
$record = array(
'Id' => $key['id'],
'Nome' => $key['name'],
'Descrizione' => $this->CutString($key['description'], 100),
'Foto' => $key['filename']
);
$doSet->push(new ArrayData($record));
}
return $doSet;
}This show me 25 result. Now I need to divide result in 3 page (10 results every page). My problem is that in this way I create 25 page and all 25 results are repeated in all 25 page. Can you help me to solve this problem and to find my error?
I think the problem is link to Count() function that find a big number of elemnts. Thanks!<% if Conn.MoreThanOnePage %>
<div id="PageNumbers">
<% if Conn.NotLastPage %>
<a class="next" href="$Conn.NextLink" title="View the next page">Next</a>
<% end_if %>
<% if Conn.NotFirstPage %>
<a class="prev" href="$Conn.PrevLink" title="View the previous page">Prev</a>
<% end_if %>
<span>
<% control Conn.Pages %>
<% if CurrentBool %>
$PageNum
<% else %>
<a href="$Link" title="View page number $PageNum">$PageNum</a>
<% end_if %>
<% end_control %>
</span>
<p>Page $Conn.CurrentPage of $Conn.TotalPages</p>
</div>
<% end_if %>
| 521 Views | ||
|
Page:
1
|
Go to Top |

