<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
	<title>jQuery Grid Plugin - jqGrid - Topic: jqGrid + ADODB5</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/jqgrid-adodb5</link>
	<description><![CDATA[Grid plugin]]></description>
	<generator>Simple:Press Version 5.7.5.3</generator>
	<atom:link href="http://www.trirand.com/blog/?page_id=393/help/jqgrid-adodb5/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>alexrainman on jqGrid + ADODB5</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/jqgrid-adodb5#p22345</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/jqgrid-adodb5#p22345</guid>
        	        	<description><![CDATA[<p>I was trying this code to use adodb library for php. The grid doesnt show me anything.</p>
<p>Neither with XML or JSON.</p>
<p>Someone can tell me what i&#39;m doing wrong?</p>
<p>&#60;?php<br />include(&#39;adodb5/adodb.inc.php&#39;);<br />$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;<br />$page = $_GET[&#39;page&#39;]; // get the requested page <br />$limit = $_GET[&#39;rows&#39;]; // get how many rows we want to have into the grid <br />$sidx = $_GET[&#39;sidx&#39;]; // get index row - i.e. user click to sort <br />$sord = $_GET[&#39;sord&#39;]; // get the direction <br />if(!$sidx) $sidx =1; <br />// connect to the database <br />$db = ADONewConnection(&#39;mysql&#39;); # eg &#39;mysql&#39; or &#39;postgres&#39;<br />$db-&#62;debug = true;<br />$db-&#62;Connect(&#39;localhost&#39;, &#39;root&#39;, &#39;admin&#39;, &#39;jQgrid_demos&#39;);<br />$row = $db-&#62;GetRow("SELECT COUNT(*) AS count FROM invheader a, clients b WHERE a.client_id=b.client_id"); <br />$count = $row[&#39;count&#39;];<br />if( $count &#62; 0 ) { <br />&#160;&#160; $total_pages = ceil($count/$limit); <br />} else { <br />&#160;&#160; $total_pages = 0; <br />} <br />if ($page &#62; $total_pages) $page = $total_pages; <br />$start = $limit * $page - $limit; // do not put $limit*($page - 1) <br />$result = $db-&#62;Execute("SELECT a.id, a.invdate, b.name, a.amount,a.tax,a.total,a.note FROM invheader a, clients b WHERE a.client_id=b.client_id ORDER BY $sidx $sord LIMIT $start, $limit");<br />$responce-&#62;page = $page; <br />$responce-&#62;total = $total_pages; <br />$responce-&#62;records = $count; <br />$i=0;<br />while ($row = $result-&#62;fetchRow()){<br />&#160;&#160; $responce-&#62;rows[$i][&#39;id&#39;]=$row[id]; <br />&#160;&#160; $responce-&#62;rows[$i][&#39;cell&#39;]=array($row[id],$row[invdate],$row[name],$row[amount],$row[tax],$row[total],$row[note]); <br />&#160;&#160; $i++; <br />} <br />echo json_encode($responce);<br />?&#62;</p>
]]></description>
        	        	<pubDate>Tue, 08 Mar 2011 18:06:10 +0200</pubDate>
        </item>
</channel>
</rss>