<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — Sr.No Not coming Properly]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=5291&amp;type=atom" />
	<updated>2014-11-06T07:13:08Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=5291</id>
		<entry>
			<title type="html"><![CDATA[Re: Sr.No Not coming Properly]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=21365#p21365" />
			<content type="html"><![CDATA[<p>Even tried&nbsp; :&nbsp; _(&quot;Sr.No.&quot;)=&gt;array(&#039;align&#039;=&gt;&#039;center&#039;,&#039;ord&#039;=&gt;&#039;desc&#039;)</p>]]></content>
			<author>
				<name><![CDATA[tester1]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=18290</uri>
			</author>
			<updated>2014-11-06T07:13:08Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=21365#p21365</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Sr.No Not coming Properly]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=21361#p21361" />
			<content type="html"><![CDATA[<p>I want to show list of my product as below :</p><br /><p>&nbsp; &nbsp; Sr.No | Name | Type <br />&nbsp; &nbsp; --------------------<br />&nbsp; &nbsp; 1&nbsp; &nbsp; &nbsp;|&nbsp; aa&nbsp; | 2<br />&nbsp; &nbsp; 2&nbsp; &nbsp; &nbsp;|&nbsp; bb&nbsp; | 2<br />&nbsp; &nbsp; 3&nbsp; &nbsp; &nbsp;|&nbsp; cc&nbsp; | 3<br />&nbsp; &nbsp; 4&nbsp; &nbsp; &nbsp;|&nbsp; dd&nbsp; | 2<br />&nbsp; &nbsp; 5&nbsp; &nbsp; &nbsp;|&nbsp; cc&nbsp; | 4 </p><br /><p>**But its coming as&nbsp; below **</p><br /><p>&nbsp; &nbsp; Sr.No | Name | Type <br />&nbsp; &nbsp; --------------------<br />&nbsp; &nbsp; 3&nbsp; &nbsp; &nbsp;|&nbsp; aa&nbsp; | 2<br />&nbsp; &nbsp; 5&nbsp; &nbsp; &nbsp;|&nbsp; bb&nbsp; | 2<br />&nbsp; &nbsp; 1&nbsp; &nbsp; &nbsp;|&nbsp; cc&nbsp; | 3<br />&nbsp; &nbsp; 4&nbsp; &nbsp; &nbsp;|&nbsp; dd&nbsp; | 2<br />&nbsp; &nbsp; 2&nbsp; &nbsp; &nbsp;|&nbsp; cc&nbsp; | 4 </p><p>Its not that i want order by name , i just want normal sr.no as per entry .. means if i add any entry first then sr.no 1 , 2 , 3 and so on..</p><p>But when i add any new entry then its sr.no get changed but it should get last sr.no </p><p>Below is what i have tried : </p><div class="codebox"><pre><code>    SELECT (@cnt := @cnt + 1) AS rowNumber, orn.name, orn.type ,  u.* 
    FROM  ofr AS u 
    CROSS JOIN (SELECT @cnt := 0) AS dummy
    LEFT JOIN  or_name AS orn ON u.id=orn.id 
    GROUP BY u.id ORDER BY rowNumber AND u.add_datetime DESC</code></pre></div><p>Listing is call in below way :</p><div class="codebox"><pre><code>    $result =   get_details()
     
    $cols = array( 
            _(&quot;Sr.No.&quot;)=&gt;array(&#039;align&#039;=&gt;&#039;center&#039;),
            _(&quot;Name&quot;)=&gt;array(&#039;align&#039;=&gt;&#039;center&#039;),
            _(&quot;Type&quot;)=&gt;array(&#039;align&#039;=&gt;&#039;center&#039;)
           );
    
    $table =&amp; new_db_pager(&#039;tablename&#039;, $result, $cols, &#039;ofr&#039;,&#039;id&#039;,10); 
    
    $table-&gt;width = &quot;95%&quot;;
    
    display_db_pager($table);</code></pre></div><br /><p>**Database :**</p><p>&nbsp; &nbsp; id : bigint(20)&nbsp; &nbsp; &nbsp; &nbsp; UNSIGNED&nbsp; &nbsp; No &nbsp; &nbsp; None&nbsp; &nbsp; AUTO_INCREMENT</p>]]></content>
			<author>
				<name><![CDATA[tester1]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=18290</uri>
			</author>
			<updated>2014-11-06T07:02:05Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=21361#p21361</id>
		</entry>
</feed>
