Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Pagination

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
krone
Smarty Rookie


Joined: 17 Apr 2013
Posts: 6

PostPosted: Thu Apr 25, 2013 11:53 am    Post subject: Pagination Reply with quote

I have a huge problem. I have a pagination made and working in php, and i don't have a clue hot to make this work with smarty. I have tried everything. Please help.

$rs = mysql_query("SELECT count(*) FROM numbers");
$rw = mysql_fetch_array($rs);

if( !(isset($_GET['page'])) )
$start = $rw[0] - 5;
else{
$start = $rw[0] - ($_GET['page'] * 5);
}

$res = mysql_query("SELECT * FROM numbers LIMIT $start, 5")
or Die("More entries coming, stay tuned!");


?>
<html>

<body>

<ul>
<?php
while( $row = mysql_fetch_array($res) ){
echo "<li>$row[number]</li>";
$num = "";
$smarty->assign ('num_',$num);}
?>
</ul>
<ul>
<li class="pagination"><a href="index.php?page=<?php
if(isset($_GET['page']))
$next = $_GET['page'] -1;
else
$next=2;
echo $next; ?>"<a>prev</a>

<li class="pagination"><a href="index.php?page=<?php
if(isset($_GET['page']))
$next = $_GET['page'] +1;
else
$next=2;
echo $next; ?>"<a>next</a>

</li>
</ul>
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP