<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Prioritus Yotto Putera Uniwaly &#187; simple paging code igniter</title>
	<atom:link href="http://rio.uniwaly.com/tag/simple-paging-code-igniter/feed/" rel="self" type="application/rss+xml" />
	<link>http://rio.uniwaly.com</link>
	<description>My Thoughts, Works, Prayer, Love and Hope !</description>
	<lastBuildDate>Fri, 03 Sep 2010 08:55:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>SIMPLE PAGING WITH CODEIGNITER FRAME WORK (English Version)</title>
		<link>http://rio.uniwaly.com/2009/09/30/simple-paging-with-codeigniter-frame-work-english-version/</link>
		<comments>http://rio.uniwaly.com/2009/09/30/simple-paging-with-codeigniter-frame-work-english-version/#comments</comments>
		<pubDate>Wed, 30 Sep 2009 07:50:29 +0000</pubDate>
		<dc:creator>Rio Yotto</dc:creator>
				<category><![CDATA[Application Development]]></category>
		<category><![CDATA[Tips & Trick]]></category>
		<category><![CDATA[controller]]></category>
		<category><![CDATA[model]]></category>
		<category><![CDATA[mvc]]></category>
		<category><![CDATA[paging with CI (code igniter)]]></category>
		<category><![CDATA[simple paging code igniter]]></category>
		<category><![CDATA[view]]></category>

		<guid isPermaLink="false">http://rio.uniwaly.com/?p=273</guid>
		<description><![CDATA[PAGING WITH CODEIGNITER FRAME WORK BY : Rio Uniwaly &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- Demo for this paging you can see it here : http://rio.uniwaly.com/programming/coba/ notes : 1. Framework used : Code Igniter (MVC) 2. I&#8217;m using MVC with View and Controller only. i&#8217;m not used Model. 4. This is my config files configuration : config.php &#8212; $config['base_url'] = <a href="http://rio.uniwaly.com/2009/09/30/simple-paging-with-codeigniter-frame-work-english-version/"><b>...Read more</b></a>]]></description>
			<content:encoded><![CDATA[<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">PAGING WITH CODEIGNITER FRAME WORK BY : Rio Uniwaly</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">Demo for this paging you can see it here : http://rio.uniwaly.com/programming/coba/</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">notes :</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">1. Framework used : Code Igniter (MVC)</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">2. I&#8217;m using MVC with View and Controller only. i&#8217;m not used Model.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">4. This is my config files configuration : config.php &#8212; $config['base_url'] = &#8220;http://localhost/programming/coba/&#8221;;</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">5. Controller: Welcome.PHP (One Controller Only)</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">&#8212;-</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">&lt;?php</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">/* paging controller sample by Rio Uniwaly</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">http://www.rio.uniwaly.com</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">http://www.godblesshosting.com</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">*/</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">class Welcome extends Controller {</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;"><span style="white-space: pre;"> </span>function Welcome()</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;"><span style="white-space: pre;"> </span>{</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;"><span style="white-space: pre;"> </span>parent::Controller();<span style="white-space: pre;"> </span></div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;"><span style="white-space: pre;"> </span>$this-&gt;load-&gt;database();</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;"><span style="white-space: pre;"> </span>}</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;"><span style="white-space: pre;"> </span></div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;"><span style="white-space: pre;"> </span>function index()</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;"><span style="white-space: pre;"> </span>{</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;"><span style="white-space: pre;"> </span></div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;"><span style="white-space: pre;"> </span>//load default paging library<span style="white-space: pre;"> </span></div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;"><span style="white-space: pre;"> </span>$this-&gt;load-&gt;library(&#8216;pagination&#8217;);</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;"><span style="white-space: pre;"> </span></div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;"><span style="white-space: pre;"> </span>//configure this according to your systems!</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;"><span style="white-space: pre;"> </span>$config['base_url'] = &#8216;http://localhost/programming/coba/index.php/welcome/&#8217;;</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;"><span style="white-space: pre;"> </span>$config['per_page'] = &#8217;3&#8242;;</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;"><span style="white-space: pre;"> </span>$config['uri_segment'] = 2;<span style="white-space: pre;"> </span></div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;"><span style="white-space: pre;"> </span></div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;"><span style="white-space: pre;"> </span>//this query only for getting total rows!</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;"><span style="white-space: pre;"> </span>$this-&gt;db-&gt;select(&#8216;nama, alamat, kota&#8217;); /* means select name,alamat,kota from member tables */</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;"><span style="white-space: pre;"> </span>$query=$this-&gt;db-&gt;get(&#8216;member&#8217;);<span style="white-space: pre;"> </span></div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;"><span style="white-space: pre;"> </span>$jumlah=$query-&gt;num_rows(); /* i put the total of the rows in jumlah variables */</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;"><span style="white-space: pre;"> </span>$config['total_rows'] = $jumlah; // save the rows for config files&#8230;</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;"><span style="white-space: pre;"> </span>$this-&gt;pagination-&gt;initialize($config);  // initialize configuration files &#8230;</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;"><span style="white-space: pre;"> </span>echo $this-&gt;pagination-&gt;create_links();</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;"><span style="white-space: pre;"> </span>$data['num']=$config['per_page'];<span style="white-space: pre;"> </span>// this important also &#8230; $num means the limit. you should know limit and offset in mysql <span style="white-space: pre;"> </span></div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;"><span style="white-space: pre;"> </span>//$data['offset']=$config['uri_segment'];</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;"><span style="white-space: pre;"> </span>$data['offset']=$this-&gt;uri-&gt;segment(2);</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;"><span style="white-space: pre;"> </span>if (!$data['offset'])</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;"><span style="white-space: pre;"> </span>{</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;"><span style="white-space: pre;"> </span>$data['offset']=0;</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;"><span style="white-space: pre;"> </span>}</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;"><span style="white-space: pre;"> </span>$data['num'] = $config['per_page'];<span style="white-space: pre;"> </span> <span style="white-space: pre;"> </span></div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;"><span style="white-space: pre;"> </span>$this-&gt;load-&gt;view(&#8216;rio&#8217;,$data);</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;"><span style="white-space: pre;"> </span>}</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">}</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">/* End of file welcome.php */</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">/* Location: ./system/application/controllers/welcome.php */</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- end of controller &#8212;&#8212;&#8212;&#8212;&#8211;</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">6. VIEWS : RIO.PHP</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">&lt;table border=1&gt;</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;"><span style="white-space: pre;"> </span>&lt;tr&gt;</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;"><span style="white-space: pre;"> </span>&lt;td&gt;Nama</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;"><span style="white-space: pre;"> </span>&lt;td&gt;Alamat</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;"><span style="white-space: pre;"> </span>&lt;td&gt;Kota</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">&lt;?</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">$this-&gt;db-&gt;select(&#8216;nama, alamat, kota&#8217;);</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">$query=$this-&gt;db-&gt;get(&#8216;member&#8217;,$num,$offset);</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">$jumlah = count($query-&gt;result());</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;"><span style="white-space: pre;"> </span>foreach ($query-&gt;result() as $row)</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;"><span style="white-space: pre;"> </span>{</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;"><span style="white-space: pre;"> </span>echo &#8220;&lt;tr&gt;&lt;td&gt;&#8221;.$row-&gt;nama;</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;"><span style="white-space: pre;"> </span>echo &#8220;&lt;td&gt;&#8221;.$row-&gt;alamat;</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;"><span style="white-space: pre;"> </span>echo &#8220;&lt;td&gt;&#8221;.$row-&gt;kota;</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;"><span style="white-space: pre;"> </span>}</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">?&gt;</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">&lt;?</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">echo &#8220;Jumlah : $jumlah&#8221;; // this is the total rows that will shown up..</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">?&gt;</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">&lt;br&gt;&lt;br&gt;</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">&lt;br&gt;&lt;br&gt;</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- END OF VIEWS &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">&#8212;- this is the database i used ..  :  start copy &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">&#8211; phpMyAdmin SQL Dump</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">&#8211; version 2.11.4</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">&#8211; http://www.phpmyadmin.net</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">&#8211;</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">&#8211; Host: localhost</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">&#8211; Generation Time: Sep 30, 2009 at 12:56 AM</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">&#8211; Server version: 5.0.51</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">&#8211; PHP Version: 5.2.5</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">SET SQL_MODE=&#8221;NO_AUTO_VALUE_ON_ZERO&#8221;;</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">&#8211;</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">&#8211; Database: `rio_ci`</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">&#8211;</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">&#8211; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">&#8211;</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">&#8211; Table structure for table `member`</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">&#8211;</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">CREATE TABLE IF NOT EXISTS `member` (</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">`id` int(11) NOT NULL auto_increment,</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">`nama` varchar(50) NOT NULL,</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">`alamat` varchar(255) NOT NULL,</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">`kota` varchar(50) NOT NULL,</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">`keterangan` text NOT NULL,</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">PRIMARY KEY  (`id`)</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=11 ;</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">&#8211;</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">&#8211; Dumping data for table `member`</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">&#8211;</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">INSERT INTO `member` (`id`, `nama`, `alamat`, `kota`, `keterangan`) VALUES</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">(1, &#8216;Rio Saja&#8217;, &#8216;jl. pilar mas raya kav. a-d&#8217;, &#8216;jakarta&#8217;, &#8216;ini keterangannya saja&#8217;),</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">(2, &#8216;andy&#8217;, &#8216;jl. diponegoro&#8217;, &#8216;bandung&#8217;, &#8216;ini usernya cumi&#8217;),</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">(3, &#8216;Elen&#8217;, &#8216;Medan&#8217;, &#8216;Medan&#8217;, &#8216;ini testing untuk elen&#8217;),</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">(4, &#8216;Tiano&#8217;, &#8216;Semanan&#8217;, &#8216;Cengkareng&#8217;, &#8216;datanya Tiano&#8217;),</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">(5, &#8216;icul&#8217;, &#8216;blok m&#8217;, &#8216;jaksel&#8217;, &#8216;jaksel data icul&#8217;),</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">(6, &#8216;lanny&#8217;, &#8216;kayumanis&#8217;, &#8216;jaktim&#8217;, &#8216;data lanny&#8217;),</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">(7, &#8216;george&#8217;, &#8216;bogor&#8217;, &#8216;bogor&#8217;, &#8216;data george&#8217;),</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">(8, &#8216;adolf&#8217;, &#8216;bekasi&#8217;, &#8216;bekasi&#8217;, &#8216;data adolf&#8217;),</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">(9, &#8216;gill&#8217;, &#8216;jatinegara&#8217;, &#8216;jaktim&#8217;, &#8216;data gill&#8217;),</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">(10, &#8216;steve&#8217;, &#8216;percetakan negara &#8216;, &#8216;jaktim&#8217;, &#8216;data steve&#8217;);</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; end copy database &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</div>
<p><strong>SIMPLE PAGING WITH CODEIGNITER FRAME WORK</strong></p>
<p><strong>Demo for this paging</strong> you can see it here : <a href="http://rio.uniwaly.com/programming/coba/"><strong>http://rio.uniwaly.com/programming/coba/</strong></a><strong> </strong></p>
<p>notes :</p>
<p>1. Framework used : <strong>Code Igniter</strong> (MVC)</p>
<p>2. I&#8217;m using <strong>MVC</strong> with View and Controller only. i&#8217;m not using Model.</p>
<p>4. This is my config files  : config.php &#8212; $config['base_url'] = &#8220;http://localhost/programming/coba/&#8221;; <span id="more-273"></span></p>
<p>5. Controller: Welcome.PHP (One Controller Only)</p>
<blockquote><p>&lt;?php</p>
<p>/* paging controller sample by Rio Uniwaly</p>
<p>http://www.rio.uniwaly.com</p>
<p>http://www.godblesshosting.com</p>
<p>*/</p>
<p>class Welcome extends Controller {</p>
<p><span style="white-space: pre;"> </span>function Welcome()</p>
<p><span style="white-space: pre;"> </span>{</p>
<p><span style="white-space: pre;"> </span>parent::Controller();<span style="white-space: pre;"> </span></p>
<p><span style="white-space: pre;"> </span>$this-&gt;load-&gt;database();</p>
<p><span style="white-space: pre;"> </span>}</p>
<p><span style="white-space: pre;"> </span></p>
<p><span style="white-space: pre;"> </span>function index()</p>
<p><span style="white-space: pre;"> </span>{</p>
<p><span style="white-space: pre;"> </span></p>
<p><span style="white-space: pre;"> </span>//load default paging library<span style="white-space: pre;"> </span></p>
<p><span style="white-space: pre;"> </span>$this-&gt;load-&gt;library(&#8216;pagination&#8217;);</p>
<p><span style="white-space: pre;"> </span></p>
<p><span style="white-space: pre;"> </span>//configure this according to your systems!</p>
<p><span style="white-space: pre;"> </span>$config['base_url'] = &#8216;http://localhost/programming/coba/index.php/welcome/&#8217;;</p>
<p><span style="white-space: pre;"> </span>$config['per_page'] = &#8217;3&#8242;;</p>
<p><span style="white-space: pre;"> </span>$config['uri_segment'] = 2;<span style="white-space: pre;"> </span></p>
<p><span style="white-space: pre;"> </span></p>
<p><span style="white-space: pre;"> </span>//this query only for getting total rows!</p>
<p><span style="white-space: pre;"> </span>$this-&gt;db-&gt;select(&#8216;nama, alamat, kota&#8217;); /* means select name,alamat,kota from member tables */</p>
<p><span style="white-space: pre;"> </span>$query=$this-&gt;db-&gt;get(&#8216;member&#8217;);<span style="white-space: pre;"> </span></p>
<p><span style="white-space: pre;"> </span>$jumlah=$query-&gt;num_rows(); /* i put the total of the rows in jumlah variables */</p>
<p><span style="white-space: pre;"> </span>$config['total_rows'] = $jumlah; // save the rows for config files&#8230;</p>
<p><span style="white-space: pre;"> </span>$this-&gt;pagination-&gt;initialize($config);  // initialize configuration files &#8230;</p>
<p><span style="white-space: pre;"> </span>echo $this-&gt;pagination-&gt;create_links();</p>
<p><span style="white-space: pre;"> </span>$data['num']=$config['per_page'];<span style="white-space: pre;"> </span>// this important also &#8230; $num means the limit. you should know limit and offset in mysql <span style="white-space: pre;"> </span></p>
<p><span style="white-space: pre;"> </span>//$data['offset']=$config['uri_segment'];</p>
<p><span style="white-space: pre;"> </span>$data['offset']=$this-&gt;uri-&gt;segment(2);</p>
<p><span style="white-space: pre;"> </span>if (!$data['offset'])</p>
<p><span style="white-space: pre;"> </span>{</p>
<p><span style="white-space: pre;"> </span>$data['offset']=0;</p>
<p><span style="white-space: pre;"> </span>}</p>
<p><span style="white-space: pre;"> </span>$data['num'] = $config['per_page'];<span style="white-space: pre;"> </span> <span style="white-space: pre;"> </span></p>
<p><span style="white-space: pre;"> </span>$this-&gt;load-&gt;view(&#8216;rio&#8217;,$data);</p>
<p><span style="white-space: pre;"> </span>}</p>
<p>}</p>
<p>/* End of file welcome.php */</p>
<p>/* Location: ./system/application/controllers/welcome.php */</p></blockquote>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; end of controller &#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>6. VIEWS : RIO.PHP</p>
<blockquote><p>&lt;table border=1&gt;</p>
<p><span style="white-space: pre;"> </span>&lt;tr&gt;</p>
<p><span style="white-space: pre;"> </span>&lt;td&gt;Nama</p>
<p><span style="white-space: pre;"> </span>&lt;td&gt;Alamat</p>
<p><span style="white-space: pre;"> </span>&lt;td&gt;Kota</p>
<p>&lt;?</p>
<p>$this-&gt;db-&gt;select(&#8216;nama, alamat, kota&#8217;);</p>
<p>$query=$this-&gt;db-&gt;get(&#8216;member&#8217;,$num,$offset);</p>
<p>$jumlah = count($query-&gt;result());</p>
<p><span style="white-space: pre;"> </span>foreach ($query-&gt;result() as $row)</p>
<p><span style="white-space: pre;"> </span>{</p>
<p><span style="white-space: pre;"> </span>echo &#8220;&lt;tr&gt;&lt;td&gt;&#8221;.$row-&gt;nama;</p>
<p><span style="white-space: pre;"> </span>echo &#8220;&lt;td&gt;&#8221;.$row-&gt;alamat;</p>
<p><span style="white-space: pre;"> </span>echo &#8220;&lt;td&gt;&#8221;.$row-&gt;kota;</p>
<p><span style="white-space: pre;"> </span>}</p>
<p>?&gt;</p>
<p>&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</p>
<p>&lt;?</p>
<p>echo &#8220;Jumlah : $jumlah&#8221;; // this is the total rows that will shown up..</p>
<p>?&gt;</p>
<p>&lt;br&gt;&lt;br&gt;</p>
<p>&lt;br&gt;&lt;br&gt;</p></blockquote>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; END OF VIEWS &#8212;&#8212;&#8212;&#8211;</p>
<p>&#8212;- this is the database i used ..  :  start copy &#8212;&#8212;&#8212;&#8211;</p>
<p>&#8211; phpMyAdmin SQL Dump</p>
<p>&#8211; version 2.11.4</p>
<p>&#8211; http://www.phpmyadmin.net</p>
<p>&#8211;</p>
<p>&#8211; Host: localhost</p>
<p>&#8211; Generation Time: Sep 30, 2009 at 12:56 AM</p>
<p>&#8211; Server version: 5.0.51</p>
<p>&#8211; PHP Version: 5.2.5</p>
<p>SET SQL_MODE=&#8221;NO_AUTO_VALUE_ON_ZERO&#8221;;</p>
<p>&#8211;</p>
<p>&#8211; Database: `rio_ci`</p>
<p>&#8211;</p>
<p>&#8211;</p>
<p>&#8211; Table structure for table `member`</p>
<p>&#8211;</p>
<blockquote><p>CREATE TABLE IF NOT EXISTS `member` (</p>
<p>`id` int(11) NOT NULL auto_increment,</p>
<p>`nama` varchar(50) NOT NULL,</p>
<p>`alamat` varchar(255) NOT NULL,</p>
<p>`kota` varchar(50) NOT NULL,</p>
<p>`keterangan` text NOT NULL,</p>
<p>PRIMARY KEY  (`id`)</p>
<p>) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=11 ;</p>
<p>&#8211;</p>
<p>&#8211; Dumping data for table `member`</p>
<p>&#8211;</p>
<p>INSERT INTO `member` (`id`, `nama`, `alamat`, `kota`, `keterangan`) VALUES</p>
<p>(1, &#8216;Rio Saja&#8217;, &#8216;jl. pilar mas raya kav. a-d&#8217;, &#8216;jakarta&#8217;, &#8216;ini keterangannya saja&#8217;),</p>
<p>(2, &#8216;andy&#8217;, &#8216;jl. diponegoro&#8217;, &#8216;bandung&#8217;, &#8216;ini usernya cumi&#8217;),</p>
<p>(3, &#8216;Elen&#8217;, &#8216;Medan&#8217;, &#8216;Medan&#8217;, &#8216;ini testing untuk elen&#8217;),</p>
<p>(4, &#8216;Tiano&#8217;, &#8216;Semanan&#8217;, &#8216;Cengkareng&#8217;, &#8216;datanya Tiano&#8217;),</p>
<p>(5, &#8216;icul&#8217;, &#8216;blok m&#8217;, &#8216;jaksel&#8217;, &#8216;jaksel data icul&#8217;),</p>
<p>(6, &#8216;lanny&#8217;, &#8216;kayumanis&#8217;, &#8216;jaktim&#8217;, &#8216;data lanny&#8217;),</p>
<p>(7, &#8216;george&#8217;, &#8216;bogor&#8217;, &#8216;bogor&#8217;, &#8216;data george&#8217;),</p>
<p>(8, &#8216;adolf&#8217;, &#8216;bekasi&#8217;, &#8216;bekasi&#8217;, &#8216;data adolf&#8217;),</p>
<p>(9, &#8216;gill&#8217;, &#8216;jatinegara&#8217;, &#8216;jaktim&#8217;, &#8216;data gill&#8217;),</p>
<p>(10, &#8216;steve&#8217;, &#8216;percetakan negara &#8216;, &#8216;jaktim&#8217;, &#8216;data steve&#8217;);</p></blockquote>
<p>&#8212;&#8212;&#8212;&#8211; end copy database &#8212;&#8212;-</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://rio.uniwaly.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://rio.uniwaly.com/2009/09/30/simple-paging-with-codeigniter-frame-work-english-version/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
