<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Code The World — Simple pagination]]></title>
	<link rel="self" href="https://codetheworld.com/extern.php?action=feed&amp;tid=78&amp;type=atom" />
	<updated>2008-06-16T04:13:40Z</updated>
	<generator>PunBB</generator>
	<id>https://codetheworld.com/viewtopic.php?id=78</id>
		<entry>
			<title type="html"><![CDATA[Simple pagination]]></title>
			<link rel="alternate" href="https://codetheworld.com/viewtopic.php?pid=220#p220" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>    $limit = 30;
    $start = ($num-1)*$limit; 
    $start = round($start,0);

            $totalpages = mysql_num_rows(mysql_query(&quot;SELECT * from `table`&quot;)); 
            $totalpages = $totalpages / $limit; 
            $totalpages = round($totalpages,0); 
            $c = 0;                                                
                    
            while($c&lt;$totalpages){                                        
            $page = $c + 1;                                                
            if($_GET[&#039;num&#039;]==$page){                                    
            echo &quot;[$page] &quot;;                            
            }else{                                                    
            echo &quot;&lt;a href=?action=pinArchive&amp;num=$page&gt;[$page] &lt;/a&gt;&quot;;
            } 
            $c = $c+1; 
            } 
            echo &quot;&lt;br&gt;&quot;.$totalpages.&quot; Pages in total.&quot;;</code></pre></div>]]></content>
			<author>
				<name><![CDATA[a3d2i2]]></name>
				<uri>https://codetheworld.com/profile.php?id=145</uri>
			</author>
			<updated>2008-06-16T04:13:40Z</updated>
			<id>https://codetheworld.com/viewtopic.php?pid=220#p220</id>
		</entry>
</feed>
