<?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>Open Script Solution&#187; record</title>
	<atom:link href="http://www.openscriptsolution.com/tag/record/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.openscriptsolution.com</link>
	<description>... where solutions for script programming are found ...</description>
	<lastBuildDate>Tue, 31 Jan 2012 03:22:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>How to Handle Duplicate Records by Deleting and Leaving Only One Record from Each Duplicate Records in MySQL Database</title>
		<link>http://www.openscriptsolution.com/2011/07/15/how-to-handle-duplicate-records-by-deleting-and-leaving-only-one-record-from-each-duplicate-records-in-mysql-database/</link>
		<comments>http://www.openscriptsolution.com/2011/07/15/how-to-handle-duplicate-records-by-deleting-and-leaving-only-one-record-from-each-duplicate-records-in-mysql-database/#comments</comments>
		<pubDate>Fri, 15 Jul 2011 15:56:45 +0000</pubDate>
		<dc:creator>Masino Sinaga</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[delete]]></category>
		<category><![CDATA[DISTINCT]]></category>
		<category><![CDATA[duplicate]]></category>
		<category><![CDATA[duplikat]]></category>
		<category><![CDATA[hapus]]></category>
		<category><![CDATA[record]]></category>

		<guid isPermaLink="false">http://www.openscriptsolution.com/?p=1350</guid>
		<description><![CDATA[Have you ever got difficulty when handling the duplicate records in a table in MySQL database, where you want to delete the records and pretty leaves one record from each duplicate records? This usually happens in the table who did not have the primary key, so that it can cause to store the duplicate records. [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever got difficulty when handling the duplicate records in a table in MySQL database, where you want to delete the records and pretty leaves one record from each duplicate records? This usually happens in the table who did not have the primary key, so that it can cause to store the duplicate records. The duplicate records are usually obtained from the data import process that was done repeatedly. Well, the following trick you can use to handle such cases. Quite easy and a little bit outsmart. The first step, you must copy the table structure that stores the duplicate records to another table name (copy table structure only, not including records). The second step, simply copy only one or distinct record from each duplicate records using a single MySQL statement to the copied/destination table. Lastly, the third step, check the results in the destination table. If everything goes smoothly, then delete the original table, and rename back the copied/destination table to the original table name. Curious? <span id="more-1350"></span></p>
<p>For example, you have a table named <strong>table1</strong> which has the structure like this:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">mysql&gt; DESCRIBE `table1`;
+-------------+-------------+------+-----+---------+-------+
| Field       | Type        | Null | Key | Default | Extra |
+-------------+-------------+------+-----+---------+-------+
| code        | char(2)     | YES  |     |         |       |
| description | varchar(50) | YES  |     | NULL    |       |
+-------------+-------------+------+-----+---------+-------+</pre></div></div>

<p>and it has the duplicate records as following:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">mysql&gt; select * from table1;
+------+-------------+
| code | description |
+------+-------------+
| 1    | One         |
| 1    | One         |
| 2    | Two         |
| 2    | Two         |
| 3    | Three       |
| 3    | Three       |
| 3    | Three       |
| 4    | Four        |
| 4    | Four        |
| 4    | Four        |
| 4    | Four        |
| 5    | Five        |
| 5    | Five        |
| 5    | Five        |
| 5    | Five        |
| 5    | Five        |
+------+-------------+</pre></div></div>

<p>Let&#8217;s say, you want to delete and leave only one record from each the duplicate records. So the results become like this:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">+------+-------------+
| code | description |
+------+-------------+
| 1    | One         |
| 2    | Two         |
| 3    | Three       |
| 4    | Four        |
| 5    | Five        |
+------+-------------+</pre></div></div>

<p>So, in order to get that results, copy only the table structure of <strong>table1</strong> to (for example) <strong>table1_copy</strong> using the following SQL statement:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">mysql&gt; CREATE TABLE `table1_copy` LIKE `table1`;</pre></div></div>

<p>Afterwards, copy or insert only one record of the duplicate records from <strong>table1</strong> into the <strong>table1_copy</strong> using the following SQL statement:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">INSERT INTO table1_copy
SELECT DISTINCT * FROM table1;</pre></div></div>

<p>Voila&#8230; here is the result:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">mysql&gt; SELECT * FROM table1_copy;
+------+-------------+
| code | description |
+------+-------------+
| 1    | One         |
| 2    | Two         |
| 3    | Three       |
| 4    | Four        |
| 5    | Five        |
+------+-------------+</pre></div></div>

<p>Ups, don&#8217;t forget to remove the <strong>table1</strong> table (assuming all the steps above goes smoothly):</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">DROP TABLE IF EXISTS `table1`;</pre></div></div>

<p>and then rename the destination table to the original one:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">RENAME TABLE `table1_copy` TO `table1`;</pre></div></div>

<p>It&#8217;s very easy, isn&#8217;t? <img src='http://www.openscriptsolution.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.openscriptsolution.com%2F2011%2F07%2F15%2Fhow-to-handle-duplicate-records-by-deleting-and-leaving-only-one-record-from-each-duplicate-records-in-mysql-database%2F&amp;title=How%20to%20Handle%20Duplicate%20Records%20by%20Deleting%20and%20Leaving%20Only%20One%20Record%20from%20Each%20Duplicate%20Records%20in%20MySQL%20Database" id="wpa2a_2"><img src="http://www.openscriptsolution.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.openscriptsolution.com/2011/07/15/how-to-handle-duplicate-records-by-deleting-and-leaving-only-one-record-from-each-duplicate-records-in-mysql-database/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>How to Know The Duplicate Records Based on The Same Value in a Field in MySQL Database</title>
		<link>http://www.openscriptsolution.com/2009/11/28/how-to-know-the-duplicate-records-based-on-the-same-value-in-a-field-in-mysql-database/</link>
		<comments>http://www.openscriptsolution.com/2009/11/28/how-to-know-the-duplicate-records-based-on-the-same-value-in-a-field-in-mysql-database/#comments</comments>
		<pubDate>Sat, 28 Nov 2009 08:10:38 +0000</pubDate>
		<dc:creator>Masino Sinaga</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[content]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[duplicate]]></category>
		<category><![CDATA[field]]></category>
		<category><![CDATA[record]]></category>
		<category><![CDATA[table]]></category>

		<guid isPermaLink="false">http://www.openscriptsolution.com/?p=921</guid>
		<description><![CDATA[Have you ever wanted to know which record has duplicate content based on the same content in a field in MySQL database? This information will be get after you select the records and display them which one have the same content by groupping them by that field. Well, here is the script how you can [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever wanted to know which record has duplicate content based on the same content in a field in MySQL database? This information will be get after you select the records and display them which one have the same content by groupping them by that field. Well, here is the script how you can do that. <span id="more-921"></span></p>
<p>Suppose we have a table named <strong>mytable</strong> which has these following records inside:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">+----+-------+
| id | name  |
+----+-------+
|  1 | One   |
|  2 | One   |
|  3 | Two   |
|  4 | Two   |
|  5 | Two   |
|  6 | Three |
|  7 | Three |
|  8 | Three |
|  9 | Three |
| 10 | Four  |
| 11 | Five  |
+----+-------+
11 rows in set (0.00 sec)</pre></div></div>

<p>and you want to display which one has the duplicate content in the <strong>name</strong> filed become like this:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">+-------+---------+
| name  | howmany |
+-------+---------+
| Three |       4 |
| Two   |       3 |
| One   |       2 |
+-------+---------+
3 rows in set (0.00 sec)</pre></div></div>

<p>In the other words, we will display the value in <strong>name</strong> field which have more than one records, whereas, the records which do not the duplicate content, will be avoided (in this case the record which have the value in field <strong>name</strong>-nya: <strong>Four</strong> and <strong>Five</strong>).</p>
<p>Well, here is the SQL script to do make it came true:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">SELECT name, COUNT(name) AS howmany 
FROM `my_table`
GROUP BY name 
HAVING howmany &gt; 1
ORDER BY howmany DESC;</pre></div></div>

<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.openscriptsolution.com%2F2009%2F11%2F28%2Fhow-to-know-the-duplicate-records-based-on-the-same-value-in-a-field-in-mysql-database%2F&amp;title=How%20to%20Know%20The%20Duplicate%20Records%20Based%20on%20The%20Same%20Value%20in%20a%20Field%20in%20MySQL%20Database" id="wpa2a_4"><img src="http://www.openscriptsolution.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.openscriptsolution.com/2009/11/28/how-to-know-the-duplicate-records-based-on-the-same-value-in-a-field-in-mysql-database/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Record per Page Limit in Client My Ticket Page in osTicket v1.6 RC5</title>
		<link>http://www.openscriptsolution.com/2009/10/23/record-per-page-limit-in-client-my-ticket-page-in-osticket-v1-6-rc5/</link>
		<comments>http://www.openscriptsolution.com/2009/10/23/record-per-page-limit-in-client-my-ticket-page-in-osticket-v1-6-rc5/#comments</comments>
		<pubDate>Fri, 23 Oct 2009 06:26:43 +0000</pubDate>
		<dc:creator>Masino Sinaga</dc:creator>
				<category><![CDATA[osTicket]]></category>
		<category><![CDATA[client]]></category>
		<category><![CDATA[limit]]></category>
		<category><![CDATA[maximum]]></category>
		<category><![CDATA[My Tickets]]></category>
		<category><![CDATA[onChange]]></category>
		<category><![CDATA[page]]></category>
		<category><![CDATA[record]]></category>
		<category><![CDATA[submit]]></category>

		<guid isPermaLink="false">http://www.openscriptsolution.com/?p=662</guid>
		<description><![CDATA[Today I made another modification into osTicket version 1.6 RC5. It was about the page limit or displaying the ticket list page based on the maximum record per page. I wanted the ability for client to choose and also to change how many records per page will be displayed in the My Ticket page. After [...]]]></description>
			<content:encoded><![CDATA[<p>Today I made another modification into osTicket version 1.6 RC5. It was about the page limit or displaying the ticket list page based on the maximum record per page. I wanted the ability for client to choose and also to change how many records per page will be displayed in the My Ticket page. After I modified, then there will be a new selection for page limit upon the ticket list on that page. When client choose a specific number from that selection or combobox, then the page will be automatically adjust to that specific number and updating the ticket list properly. So here is the code. <span id="more-662"></span></p>
<ol>
<li>
Open your <strong>\include\client\tickets.inc.php</strong> file, and find this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>75
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>div style<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;margin: 10px 0 60px 0;&quot;</span><span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>after the last line of that code above, please insert this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>76
77
78
79
80
81
82
83
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;script language</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;JavaScript&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #000000; font-weight: bold;">function</span> submitForm<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  param<span style="color: #339933;">=</span>document<span style="color: #339933;">.</span>form<span style="color: #339933;">.</span>limit<span style="color: #339933;">.</span>options<span style="color: #009900;">&#91;</span>document<span style="color: #339933;">.</span>form<span style="color: #339933;">.</span>limit<span style="color: #339933;">.</span>selectedIndex<span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span>value<span style="color: #339933;">;</span>
  url<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;?limit=&quot;</span><span style="color: #339933;">+</span>param<span style="color: #339933;">+</span><span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
  location<span style="color: #339933;">.</span>href<span style="color: #339933;">=</span>url<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">&lt;/script&gt;</span>
<span style="color: #339933;">&lt;</span>form name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;form&quot;</span><span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>Find again this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>86
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">        &lt;td width=&quot;60%&quot; class=&quot;msg&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$showing</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&amp;nbsp;&amp;nbsp;<span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$results_type</span><span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>after that line, please insert this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>87
88
89
90
91
92
93
94
95
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">            &amp;nbsp;Limit:
            &lt;select name='limit' onChange=&quot;submitForm(this.form)&quot;&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> 
            <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$x</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">5</span><span style="color: #339933;">;</span> <span style="color: #000088;">$x</span> <span style="color: #339933;">&lt;=</span> <span style="color: #cc66cc;">50</span><span style="color: #339933;">;</span> <span style="color: #000088;">$x</span> <span style="color: #339933;">+=</span> <span style="color: #cc66cc;">5</span><span style="color: #009900;">&#41;</span>
	    <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
	       &lt;option  value=&quot;<span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$x</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; <span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$pagelimit</span><span style="color: #339933;">==</span><span style="color: #000088;">$x</span> <span style="color: #009900;">&#41;</span>?<span style="color: #0000ff;">'selected'</span><span style="color: #339933;">:</span><span style="color: #0000ff;">''</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&gt;<span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$x</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/option&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
            &lt;/select&gt;
            &amp;nbsp;&amp;nbsp;</pre></td></tr></table></div>

<p>Find again this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>104
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"> <span style="color: #339933;">&lt;/</span>table<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>after that line, please insert this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>105
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"> <span style="color: #339933;">&lt;/</span>form<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

</li>
</ol>
<p>That&#8217;s all. Now client can choose the page limit when displaying the ticket list from My Ticket page.</p>
<p><img src="http://img26.imageshack.us/img26/365/osticket16rc5pagelimitc.jpg" alt="Page limit selection on My Tickets Page for Client in osTicket v1.6 RC5" /></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.openscriptsolution.com%2F2009%2F10%2F23%2Frecord-per-page-limit-in-client-my-ticket-page-in-osticket-v1-6-rc5%2F&amp;title=Record%20per%20Page%20Limit%20in%20Client%20My%20Ticket%20Page%20in%20osTicket%20v1.6%20RC5" id="wpa2a_6"><img src="http://www.openscriptsolution.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.openscriptsolution.com/2009/10/23/record-per-page-limit-in-client-my-ticket-page-in-osticket-v1-6-rc5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Add Custom Record Number in Table List of PodPages</title>
		<link>http://www.openscriptsolution.com/2009/09/21/how-to-add-custom-record-number-in-table-list-of-podpages/</link>
		<comments>http://www.openscriptsolution.com/2009/09/21/how-to-add-custom-record-number-in-table-list-of-podpages/#comments</comments>
		<pubDate>Mon, 21 Sep 2009 13:29:49 +0000</pubDate>
		<dc:creator>Masino Sinaga</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[custom]]></category>
		<category><![CDATA[list]]></category>
		<category><![CDATA[number]]></category>
		<category><![CDATA[PodPages]]></category>
		<category><![CDATA[Pods]]></category>
		<category><![CDATA[record]]></category>
		<category><![CDATA[table]]></category>

		<guid isPermaLink="false">http://www.openscriptsolution.com/?p=387</guid>
		<description><![CDATA[I have just found the way how to add custom record number in the table list of PodPages in WordPress Pods CMS plugin. I optimize the PodPages feature for this purpose by using Bypassing Templates technique. Currently, up to Pods CMS version 1.7.3, you can only use the id field from the table as your [...]]]></description>
			<content:encoded><![CDATA[<p>I have just found the way how to add custom record number in the table list of PodPages in <a href="http://pods.uproot.us/" target="_blank">WordPress Pods CMS plugin</a>. I optimize the PodPages feature for this purpose by using <a href="http://pods.uproot.us/codex/templates#bypassing_templates" target="_blank">Bypassing Templates</a> technique. Currently, up to Pods CMS version 1.7.3, you can only use the <strong>id</strong> field from the table as your record number column. Unfortunately, if you delete one or some of the record(s) from the table, then there will be missing number when you displaying this record number that you get from that <strong>id</strong> field. Besides that, if you search or filter the certain record, then the record number on the result will not continuously (there will be some missing number). So, here is the solution that I made to fix that problem, by adding the custom record number column based on the number of record in a page or in the table result. <span id="more-387"></span></p>
<p>In this example below, I used <strong>state</strong> data type that currently exists in <strong>wp_pod_tbl_state</strong> table.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> 
get_header<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
&nbsp;
<span style="color: #000088;">$Record</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Pod<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'state'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$pagelimit</span> <span style="color: #339933;">=</span> <span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'limit'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> ? <span style="color: #0000ff;">'10'</span> <span style="color: #339933;">:</span> <span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'limit'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> 
<span style="color: #000088;">$Record</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">findRecords</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'id ASC'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$pagelimit</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span> <span style="color: #339933;">&gt;</span> <span style="color: #000088;">$Record</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getTotalRows</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span> 
&nbsp;
  <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;h2&gt;The List of State&lt;/h2&gt;&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;br /&gt;&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$Record</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getFilters</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'Filter'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$total_rows</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$Record</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getTotalRows</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Total Record = &lt;b&gt;&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$total_rows</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;/b&gt;&lt;br /&gt;&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;br /&gt;&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$Record</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getPagination</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Page:'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;br /&gt;&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;br /&gt;Click on the Name to display its abbreviation.&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;table border='1' width='100<span style="color: #009933; font-weight: bold;">%' c</span>ellpadding='2'&gt;&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;tr&gt;&lt;td align='right' width='15%'&gt;&lt;b&gt;Record #&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&lt;b&gt;State Name&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$i</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$pg</span> <span style="color: #339933;">=</span> <span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'pg'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>?<span style="color: #0000ff;">'1'</span><span style="color: #339933;">:</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'pg'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$Record</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">fetchRecord</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
    <span style="color: #666666; font-style: italic;">// process the record number</span>
    <span style="color: #000088;">$no</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$i</span> <span style="color: #339933;">+</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$pg</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">*</span><span style="color: #000088;">$pagelimit</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$abbrev</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$Record</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_field</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'abbrev'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;tr&gt;&lt;td align='right'&gt;&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$no</span> <span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;.&amp;nbsp;&lt;/td&gt;&lt;td&gt;&lt;a href='http://www.openscriptsolution.com/data/states/&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$abbrev</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;'&gt;&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$Record</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_field</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;/a&gt;&lt;/td&gt;&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$i</span><span style="color: #339933;">++;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;/table&gt;&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;br /&gt;&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$Record</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getPagination</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Page:'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;a href=&quot;javascript:history.go(-1)&quot;&gt;Back to Previous Page&lt;/a&gt; | &lt;a href=&quot;http://www.openscriptsolution.com/data/states/&quot;&gt;Back to Index Page&lt;/a&gt;&lt;/div&gt;'</span><span style="color: #339933;">;</span>
&nbsp;
get_footer<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>You can see its demo at: <a href="http://www.openscriptsolution.com/data/states/" target="_blank">http://www.openscriptsolution.com/data/states/</a>.<br />
I hope this is helpful.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.openscriptsolution.com%2F2009%2F09%2F21%2Fhow-to-add-custom-record-number-in-table-list-of-podpages%2F&amp;title=How%20to%20Add%20Custom%20Record%20Number%20in%20Table%20List%20of%20PodPages" id="wpa2a_8"><img src="http://www.openscriptsolution.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.openscriptsolution.com/2009/09/21/how-to-add-custom-record-number-in-table-list-of-podpages/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
